/usr/share/tcltk/tcl8.6/vtk/rtImageTest.tcl is in tcl-vtk 5.8.0-14.1ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | # setup some common things for testing
vtkObject rtTempObject
vtkMath rtExMath
rtExMath RandomSeed 6
# create the testing class to do the work
vtkTesting rtTester
for {set i 1} {$i < $argc} {incr i} {
rtTester AddArgument "[lindex $argv $i]"
}
set VTK_DATA_ROOT [rtTester GetDataRoot]
for {set i 1} {$i < [expr $argc - 1]} {incr i} {
if {[lindex $argv $i] == "-A"} {
foreach dir [split [lindex $argv [expr $i +1]] ":"] {
lappend auto_path $dir
}
}
}
# load in the script
set file [lindex $argv 0]
# set the default threshold, the Tcl script may change this
set threshold -1
if {[info commands wm] != ""} {
wm withdraw .
} else {
# There is no Tk. Help the tests run without it.
proc wm args {
puts "wm not implemented"
}
# The vtkinteraction package requires Tk but since Tk is not
# available it will never be used anyway. Just pretend it is
# already loaded so that tests that load it will not try to load Tk.
package provide vtkinteraction 5.3
}
# Run the test.
source $file
if {[info commands iren] == "iren"} {renWin Render}
# run the event loop quickly to map any tkwidget windows
update
# current directory
set rtResult 0
if {[rtTester IsValidImageSpecified] != 0} {
# look for a renderWindow ImageWindow or ImageViewer
# first check for some common names
if {[info commands renWin] == "renWin"} {
rtTester SetRenderWindow renWin
if {$threshold == -1} {
set threshold 10
}
} else {
if {$threshold == -1} {
set threshold 5
}
if {[info commands viewer] == "viewer"} {
rtTester SetRenderWindow [viewer GetRenderWindow]
viewer Render
} else {
if {[info commands imgWin] == "imgWin"} {
rtTester SetRenderWindow imgWin
imgWin Render
} else {
if {[info exists viewer]} {
rtTester SetRenderWindow [$viewer GetRenderWindow]
}
}
}
}
set rtResult [rtTester RegressionTest $threshold]
}
if {[rtTester IsInteractiveModeSpecified] != 0} {
if {[info commands iren] == "iren"} {
iren Start
}
}
vtkCommand DeleteAllObjects
catch {destroy .top}
catch {destroy .geo}
if {$rtResult == 0} {exit 1}
exit 0
|