File: rtImageTest.tcl

package info (click to toggle)
paraview 4.0.1-1~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 526,572 kB
  • sloc: cpp: 2,284,430; ansic: 816,374; python: 239,936; xml: 70,162; tcl: 48,295; fortran: 39,116; yacc: 5,466; java: 3,518; perl: 3,107; lex: 1,620; sh: 1,555; makefile: 932; asm: 471; pascal: 228
file content (99 lines) | stat: -rw-r--r-- 2,700 bytes parent folder | download | duplicates (12)
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
90
91
92
93
94
95
96
97
98
99
package require vtk

# 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]
set FoundData 1
if { [string match "*VTK_DATA_ROOT-NOTFOUND" $VTK_DATA_ROOT] == 1 } {
  set FoundData 0
}

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

# only regression test if VTK_DATA_ROOT is defined
if { $FoundData == 1} {
    # 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
        }
    }
} else {
    set rtResult 1
}
vtkCommand DeleteAllObjects
catch {destroy .top}
catch {destroy .geo}

if {$rtResult == 0} {exit 1}
exit 0