Changeset 2034
- Timestamp:
- Jan 14, 2011, 2:34:32 PM (14 years ago)
- Location:
- trunk/tester
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tester/test.tcl
r2032 r2034 19 19 20 20 constructor {toolxml testxml} { #defined later } 21 destructor { #defined later } 21 22 22 23 private variable _added "" … … 72 73 73 74 # ---------------------------------------------------------------------- 75 # DESTRUCTOR 76 # ---------------------------------------------------------------------- 77 itcl::body Rappture::Tester::Test::destructor {} { 78 itcl::delete object $_toolobj 79 itcl::delete object $_testobj 80 if {$_ran} { 81 itcl::delete object $_runobj 82 } 83 } 84 85 # ---------------------------------------------------------------------- 74 86 # USAGE: getAdded 75 87 # … … 215 227 # ---------------------------------------------------------------------- 216 228 itcl::body Rappture::Tester::Test::run {} { 229 # Delete existing library if rerun 230 if {$_ran} { 231 itcl::delete object $_runobj 232 } 217 233 set driver [makeDriver] 218 234 set tool [Rappture::Tool ::#auto $driver [file dirname $_toolxml]] -
trunk/tester/tester.tcl
r2033 r2034 110 110 # ---------------------------------------------------------------------- 111 111 proc Rappture::Tester::selectionHandler {args} { 112 puts sh113 112 global lastsel 114 113 set test [.tree getTest] -
trunk/tester/testtree.tcl
r2031 r2034 116 116 } 117 117 } 118 119 # TODO: destructor 118 120 119 121 # ---------------------------------------------------------------------- … … 254 256 # ---------------------------------------------------------------------- 255 257 itcl::body Rappture::Tester::TestTree::populate {} { 258 # TODO: Delete existing test objects 256 259 $itk_component(treeview) delete 0 257 260 # TODO: add an appropriate icon -
trunk/tester/testview.tcl
r2032 r2034 30 30 inherit itk::Widget 31 31 32 public variable test32 itk_option define -test test Test "" 33 33 34 34 constructor {args} { #defined later } … … 105 105 # ---------------------------------------------------------------------- 106 106 itcl::configbody Rappture::Tester::TestView::test { 107 set test $itk_option(-test) 107 108 # Data array is empty for branch nodes. 108 109 if {$test != ""} { … … 116 117 Error {showStatus "Error while running test."} 117 118 } 118 updateInfo $test119 119 } else { 120 120 showStatus "Test has not yet ran." 121 updateInfo122 }123 update Results $test124 updateInputs $test121 } 122 updateResults 123 updateInfo 124 updateInputs 125 125 set descr [[$test getTestobj] get test.description] 126 126 if {$descr == ""} { … … 180 180 181 181 # ---------------------------------------------------------------------- 182 # USAGE: updateResults ?test? 183 # 184 # Clears the analyzer and loads the given library objects. Used to load 185 # both the golden result as well as the test result. Clears the 186 # analyzer space if no arguments are given. 187 # ---------------------------------------------------------------------- 188 itcl::body Rappture::Tester::TestView::updateResults {args} { 182 # USAGE: updateResults 183 # ---------------------------------------------------------------------- 184 itcl::body Rappture::Tester::TestView::updateResults {} { 189 185 $itk_component(results) clear -nodelete 190 if {[llength $args] == 0} { 186 set test $itk_option(-test) 187 if {$test == ""} { 191 188 # Already cleared, do nothing. 192 189 # TODO: Eventually display some kinds of message here. 193 } elseif {[llength $args] == 1} { 190 } else { 191 set test $itk_option(-test) 194 192 $itk_component(results) load [$test getTestobj] 195 193 if {[$test hasRan]} { … … 197 195 } 198 196 } 199 200 } 201 202 # ---------------------------------------------------------------------- 203 # USAGE: updateInfo ?test? 204 # 205 # Given a set of key value pairs from the test tree, update the info 206 # page of the testview widget. If no arguments are given, disable the 207 # info page. 208 # ---------------------------------------------------------------------- 209 itcl::body Rappture::Tester::TestView::updateInfo {args} { 210 if {[llength $args] == 0} { 197 } 198 199 # ---------------------------------------------------------------------- 200 # USAGE: updateInfo 201 # ---------------------------------------------------------------------- 202 itcl::body Rappture::Tester::TestView::updateInfo {} { 203 set test $itk_option(-test) 204 if {$test == "" || ![$test hasRan]} { 211 205 $itk_component(info) delete 0.0 end 212 206 set index [$itk_component(tabs) index -name "Results"] … … 214 208 $itk_component(tabs) focus $index 215 209 $itk_component(tabs) tab configure "Info" -state disabled 216 } elseif {[llength $args] == 1} { 210 } else { 211 set test $itk_option(-test) 217 212 set testxml [$test getTestxml] 218 213 set runfile [$test getRunfile] … … 229 224 $itk_component(info) insert end "Added: $added\n" 230 225 } 231 } else { 232 error "wrong # args: should be \"updateInfo ?test?\"" 233 } 234 } 235 236 itcl::body Rappture::Tester::TestView::updateInputs {args} { 237 if {[llength $args] == 0} { 226 } 227 } 228 229 itcl::body Rappture::Tester::TestView::updateInputs {} { 230 set test $itk_option(-test) 231 if {$test == ""} { 238 232 set index [$itk_component(tabs) index -name "Results"] 239 233 $itk_component(tabs) select $index 240 234 $itk_component(tabs) focus $index 241 235 $itk_component(tabs) tab configure "Inputs" -state disabled 242 } elseif {[llength $args] == 1} { 236 } else { 237 set test $itk_option(-test) 243 238 $itk_component(tabs) tab configure "Inputs" -state normal 244 } else { 245 error "wrong # args: should be \"updateInfo ?test?\"" 246 } 247 } 248 239 } 240 } 241
Note: See TracChangeset
for help on using the changeset viewer.