- Timestamp:
- Jan 19, 2011, 6:32:48 PM (14 years ago)
- Location:
- trunk/tester
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tester/tclIndex
r2026 r2053 7 7 # a script that loads the command. 8 8 9 set auto_index(::Rappture::Analyzer) [list source [file join $dir analyzer.tcl]] 10 set auto_index(::Rappture::Analyzer::constructor) [list source [file join $dir analyzer.tcl]] 11 set auto_index(::Rappture::Analyzer::destructor) [list source [file join $dir analyzer.tcl]] 12 set auto_index(::Rappture::Analyzer::simulate) [list source [file join $dir analyzer.tcl]] 13 set auto_index(::Rappture::Analyzer::reset) [list source [file join $dir analyzer.tcl]] 14 set auto_index(::Rappture::Analyzer::load) [list source [file join $dir analyzer.tcl]] 15 set auto_index(::Rappture::Analyzer::clear) [list source [file join $dir analyzer.tcl]] 16 set auto_index(::Rappture::Analyzer::_simState) [list source [file join $dir analyzer.tcl]] 17 set auto_index(::Rappture::Analyzer::_simOutput) [list source [file join $dir analyzer.tcl]] 18 set auto_index(::Rappture::Analyzer::_resultTooltip) [list source [file join $dir analyzer.tcl]] 19 set auto_index(::Rappture::Analyzer::_fixSimControl) [list source [file join $dir analyzer.tcl]] 20 set auto_index(::Rappture::Analyzer::_fixNotebook) [list source [file join $dir analyzer.tcl]] 21 set auto_index(::Rappture::Analyzer::_isPdbTrajectory) [list source [file join $dir analyzer.tcl]] 22 set auto_index(::Rappture::Analyzer::_isLammpsTrajectory) [list source [file join $dir analyzer.tcl]] 23 set auto_index(::Rappture::Analyzer::_pdbToSequence) [list source [file join $dir analyzer.tcl]] 24 set auto_index(::Rappture::Analyzer::_lammpsToSequence) [list source [file join $dir analyzer.tcl]] 25 set auto_index(::Rappture::Analyzer::_trajToSequence) [list source [file join $dir analyzer.tcl]] 26 set auto_index(::Rappture::Analyzer::simcontrol) [list source [file join $dir analyzer.tcl]] 27 set auto_index(::Rappture::Analyzer::notebookpage) [list source [file join $dir analyzer.tcl]] 9 28 set auto_index(::Rappture::Tester::Test) [list source [file join $dir test.tcl]] 10 29 set auto_index(::Rappture::Tester::Test::constructor) [list source [file join $dir test.tcl]] 30 set auto_index(::Rappture::Tester::Test::destructor) [list source [file join $dir test.tcl]] 11 31 set auto_index(::Rappture::Tester::Test::getAdded) [list source [file join $dir test.tcl]] 12 32 set auto_index(::Rappture::Tester::Test::getDiffs) [list source [file join $dir test.tcl]] 33 set auto_index(::Rappture::Tester::Test::getInputs) [list source [file join $dir test.tcl]] 13 34 set auto_index(::Rappture::Tester::Test::getMissing) [list source [file join $dir test.tcl]] 35 set auto_index(::Rappture::Tester::Test::getOutputs) [list source [file join $dir test.tcl]] 14 36 set auto_index(::Rappture::Tester::Test::getResult) [list source [file join $dir test.tcl]] 15 37 set auto_index(::Rappture::Tester::Test::getRunfile) [list source [file join $dir test.tcl]] 38 set auto_index(::Rappture::Tester::Test::getRunobj) [list source [file join $dir test.tcl]] 16 39 set auto_index(::Rappture::Tester::Test::getTestxml) [list source [file join $dir test.tcl]] 40 set auto_index(::Rappture::Tester::Test::getTestobj) [list source [file join $dir test.tcl]] 17 41 set auto_index(::Rappture::Tester::Test::hasRan) [list source [file join $dir test.tcl]] 18 42 set auto_index(::Rappture::Tester::Test::regoldenize) [list source [file join $dir test.tcl]] … … 27 51 set auto_index(::Rappture::ResultsPage::constructor) [list source [file join $dir resultspage.tcl]] 28 52 set auto_index(::Rappture::ResultsPage::destructor) [list source [file join $dir resultspage.tcl]] 53 set auto_index(::Rappture::ResultsPage::promptcommand) [list source [file join $dir resultspage.tcl]] 29 54 set auto_index(::Rappture::ResultsPage::_fixResult) [list source [file join $dir resultspage.tcl]] 30 55 set auto_index(::Rappture::ResultsPage::download) [list source [file join $dir resultspage.tcl]] … … 36 61 set auto_index(::Rappture::ResultsPage::_plot) [list source [file join $dir resultspage.tcl]] 37 62 set auto_index(::Rappture::ResultsPage::_reorder) [list source [file join $dir resultspage.tcl]] 63 set auto_index(::Rappture::ResultsPage::resultset) [list source [file join $dir resultspage.tcl]] 38 64 set auto_index(::Rappture::Tester::selectionHandler) [list source [file join $dir tester.tcl]] 39 65 set auto_index(::Rappture::Tester::regoldenize) [list source [file join $dir tester.tcl]] … … 55 81 set auto_index(::Rappture::Tester::TestView) [list source [file join $dir testview.tcl]] 56 82 set auto_index(::Rappture::Tester::TestView::constructor) [list source [file join $dir testview.tcl]] 57 set auto_index(::Rappture::Tester::TestView::toolxml) [list source [file join $dir testview.tcl]]58 83 set auto_index(::Rappture::Tester::TestView::test) [list source [file join $dir testview.tcl]] 59 84 set auto_index(::Rappture::Tester::TestView::reset) [list source [file join $dir testview.tcl]] 60 85 set auto_index(::Rappture::Tester::TestView::showDescription) [list source [file join $dir testview.tcl]] 61 86 set auto_index(::Rappture::Tester::TestView::showStatus) [list source [file join $dir testview.tcl]] 62 set auto_index(::Rappture::Tester::TestView::updateAnalyzer) [list source [file join $dir testview.tcl]] 63 set auto_index(::Rappture::Tester::TestView::updateInfo) [list source [file join $dir testview.tcl]] 87 set auto_index(::Rappture::Tester::TestView::updateResults) [list source [file join $dir testview.tcl]] 88 set auto_index(::Rappture::Tester::TestView::updateInputs) [list source [file join $dir testview.tcl]] 89 set auto_index(::Rappture::Tester::TestView::updateOutputs) [list source [file join $dir testview.tcl]] -
trunk/tester/test.tcl
r2034 r2053 35 35 public method getAdded {} 36 36 public method getDiffs {} 37 public method getInputs {{path input}} 37 38 public method getMissing {} 39 public method getOutputs {{path output}} 38 40 public method getResult {} 39 41 public method getRunfile {} … … 69 71 } 70 72 # HACK: Add a new input to differentiate between results 71 $_testobj put input. run.current "Golden"73 $_testobj put input.TestRun.current "Golden" 72 74 } 73 75 … … 110 112 } 111 113 114 # ----------------------------------------------------------------------- 115 # USAGE: getInputs 116 # 117 # TODO 118 # ----------------------------------------------------------------------- 119 itcl::body Rappture::Tester::Test::getInputs {{path input}} { 120 set retval [list] 121 foreach child [$_testobj children $path] { 122 set fullpath $path.$child 123 if {$fullpath != "input.TestRun"} { 124 set val [$_testobj get $fullpath.current] 125 if {$val != ""} { 126 lappend retval $fullpath $val 127 } 128 } 129 append retval [getInputs $fullpath] 130 } 131 return $retval 132 } 133 112 134 # ---------------------------------------------------------------------- 113 135 # USAGE: getMissing … … 122 144 } 123 145 return $_missing 146 } 147 148 # ---------------------------------------------------------------------- 149 # USAGE: getOutputs 150 # 151 # TODO 152 # ---------------------------------------------------------------------- 153 itcl::body Rappture::Tester::Test::getOutputs {{path output}} { 154 if {!$_ran} { 155 error "Test has not yet been ran." 156 } 157 set retval [list] 158 foreach child [$_runobj children $path] { 159 set fullpath $path.$child 160 if {$fullpath != "output.time" && $fullpath != "output.user" && $fullpath != "output.status"} { 161 if {[lsearch $fullpath [getDiffs]] != -1} { 162 set status diff 163 } elseif {[lsearch $fullpath [getAdded]] != -1} { 164 set status added 165 #} elseif {[lsearch $fullpath [getMissing]] != -1} { 166 # set status missing 167 } else { 168 if {[$_runobj get $fullpath] != ""} { 169 set status ok 170 } else { 171 set status "" 172 } 173 } 174 lappend retval $fullpath $status 175 } 176 append retval " [getOutputs $fullpath]" 177 } 178 # We won't find missing elements by searching through runobj. Instead, 179 # tack on all missing items at the end (only do this once) 180 if {$path == "output"} { 181 foreach item $_missing { 182 lappend retval $item missing 183 } 184 } 185 return $retval 124 186 } 125 187 … … 237 299 if {$status == 0 && [Rappture::library isvalid $_runobj]} { 238 300 # HACK: Add a new input to differentiate between results 239 $_runobj put input. run.current "Test result"301 $_runobj put input.TestRun.current "Test result" 240 302 set _diffs [diffs $_testobj $_runobj] 241 303 set _missing [missing $_testobj $_runobj] … … 248 310 } 249 311 } else { 312 set _runobj "" 250 313 set _result Error 251 314 } -
trunk/tester/tester.tcl
r2050 r2053 112 112 global lastsel 113 113 set test [.tree getTest] 114 if {$test != ""|| [lsearch $args "-refresh"] != -1} {114 if {$test != $lastsel || [lsearch $args "-refresh"] != -1} { 115 115 .right.view configure -test $test 116 116 if {$test != "" && [$test hasRan] && [$test getResult] != "Error"} { -
trunk/tester/testtree.tcl
r2050 r2053 67 67 itk_component add treeview { 68 68 blt::treeview $itk_component(scrollbars).treeview -separator | \ 69 -autocreate true -selectmode single69 -autocreate true -selectmode multiple 70 70 } { 71 71 keep -foreground -font -cursor … … 287 287 runTest $id 288 288 } 289 eval $itk_option(-selectcommand) -refresh 289 # Try calling selectcommand with the -refresh option. If selectcommand 290 # does not accept this argument, then call it with no arguments. 291 if {[catch {eval $itk_option(-selectcommand) -refresh}]} { 292 eval $itk_option(-selectcommand) 293 } 290 294 } 291 295 -
trunk/tester/testview.tcl
r2050 r2053 38 38 protected method showStatus {text} 39 39 protected method updateResults {args} 40 protected method updateInfo {args}41 40 protected method updateInputs {args} 42 private variable _lastTest "" 41 protected method updateOutputs {args} 42 43 43 } 44 44 … … 53 53 pack $itk_component(status) -expand no -fill none -side top -anchor w 54 54 55 itk_component add scroller {56 Rappture::Scroller $itk_interior. scroller \55 itk_component add descScroller { 56 Rappture::Scroller $itk_interior.descScroller \ 57 57 -xscrollmode auto -yscrollmode auto 58 58 } 59 59 60 60 itk_component add description { 61 text $itk_interior. scroller.description -height 0 -wrap word \61 text $itk_interior.descScroller.description -height 0 -wrap word \ 62 62 -relief flat 63 63 } 64 $itk_component( scroller) contents $itk_component(description)65 pack $itk_component( scroller) -expand no -fill x -side top64 $itk_component(descScroller) contents $itk_component(description) 65 pack $itk_component(descScroller) -expand no -fill x -side top 66 66 67 67 itk_component add tabs { … … 72 72 } 73 73 $itk_component(tabs) insert end "Results" -ipady 25 -fill both 74 $itk_component(tabs) insert end "Info" -ipady 25 -fill both -state disabled75 74 $itk_component(tabs) insert end "Inputs" -ipady 25 -fill both \ 76 75 -state disabled 76 $itk_component(tabs) insert end "Outputs" -ipady 25 -fill both \ 77 -state disabled 77 78 78 79 itk_component add results { … … 82 83 -window $itk_component(tabs).results 83 84 84 itk_component add info { 85 text $itk_component(tabs).info 86 } 87 $itk_component(tabs) tab configure "Info" -window $itk_component(info) 88 pack $itk_component(tabs) -expand yes -fill both -side top 85 itk_component add inputScroller { 86 Rappture::Scroller $itk_component(tabs).inputScroller \ 87 -xscrollmode auto -yscrollmode auto 88 } 89 89 90 90 itk_component add inputs { 91 blt::treeview $itk_component(tabs).inputs -separator . -autocreate true 91 blt::treeview $itk_component(inputScroller).inputs -separator . \ 92 -autocreate true 92 93 } { 93 94 keep -foreground -font -cursor 94 95 } 95 $itk_component(tabs) tab configure "Inputs" -window $itk_component(inputs) 96 $itk_component(inputs) column insert end "Value" 97 $itk_component(inputScroller) contents $itk_component(inputs) 98 $itk_component(tabs) tab configure "Inputs" \ 99 -window $itk_component(inputScroller) 100 101 itk_component add outputScroller { 102 Rappture::Scroller $itk_component(tabs).outputScroller \ 103 -xscrollmode auto -yscrollmode auto 104 } 105 106 itk_component add outputs { 107 blt::treeview $itk_component(outputScroller).outputs -separator . \ 108 -autocreate true 109 } { 110 keep -foreground -font -cursor 111 } 112 $itk_component(outputs) column insert end "Status" 113 $itk_component(outputScroller) contents $itk_component(outputs) 114 $itk_component(tabs) tab configure "Outputs" \ 115 -window $itk_component(outputScroller) 116 117 pack $itk_component(tabs) -expand yes -fill both -side top 96 118 97 119 eval itk_initialize $args … … 106 128 itcl::configbody Rappture::Tester::TestView::test { 107 129 set test $itk_option(-test) 108 if { $test == $_lastTest } {109 return110 }111 130 # Data array is empty for branch nodes. 112 131 if {$test != ""} { … … 124 143 } 125 144 updateResults 126 updateInfo127 145 updateInputs 146 updateOutputs 128 147 set descr [[$test getTestobj] get test.description] 129 148 if {$descr == ""} { … … 131 150 } 132 151 showDescription $descr 133 set _lastTest $test134 152 } else { 135 153 # Clear everything if branch node selected 136 set _lastTest ""137 154 reset 138 155 } … … 150 167 itcl::body Rappture::Tester::TestView::reset {} { 151 168 updateResults 152 updateInfo153 169 updateInputs 170 updateOutputs 154 171 showStatus "" 155 172 showDescription "" … … 196 213 set test $itk_option(-test) 197 214 $itk_component(results) load [$test getTestobj] 198 if {[$test hasRan] } {215 if {[$test hasRan] && [Rappture::library isvalid [$test getRunobj]]} { 199 216 $itk_component(results) load [$test getRunobj] 200 217 } … … 202 219 } 203 220 204 # ---------------------------------------------------------------------- 205 # USAGE: updateInfo 206 # ---------------------------------------------------------------------- 207 itcl::body Rappture::Tester::TestView::updateInfo {} { 208 set test $itk_option(-test) 209 if {$test == "" || ![$test hasRan]} { 210 $itk_component(info) delete 0.0 end 211 set index [$itk_component(tabs) index -name "Results"] 212 $itk_component(tabs) select $index 213 $itk_component(tabs) focus $index 214 $itk_component(tabs) tab configure "Info" -state disabled 215 } else { 216 set test $itk_option(-test) 217 set testxml [$test getTestxml] 218 set runfile [$test getRunfile] 219 $itk_component(tabs) tab configure "Info" -state normal 220 $itk_component(info) delete 0.0 end 221 $itk_component(info) insert end "Test xml: $testxml\n" 222 $itk_component(info) insert end "Runfile: $runfile\n" 223 if {[$test getResult] == "Fail"} { 224 set diffs [$test getDiffs] 225 set missing [$test getMissing] 226 set added [$test getAdded] 227 $itk_component(info) insert end "Diffs: $diffs\n" 228 $itk_component(info) insert end "Missing: $missing\n" 229 $itk_component(info) insert end "Added: $added\n" 230 } 231 } 232 } 233 234 itcl::body Rappture::Tester::TestView::updateInputs {} { 235 set test $itk_option(-test) 236 if {$test == ""} { 237 set index [$itk_component(tabs) index -name "Results"] 238 $itk_component(tabs) select $index 239 $itk_component(tabs) focus $index 240 $itk_component(tabs) tab configure "Inputs" -state disabled 241 } else { 242 set test $itk_option(-test) 221 itcl::body Rappture::Tester::TestView::updateInputs {args} { 222 $itk_component(inputs) delete 0 223 set test $itk_option(-test) 224 if {$test != ""} { 243 225 $itk_component(tabs) tab configure "Inputs" -state normal 244 } 245 } 246 226 foreach {path val} [$test getInputs] { 227 $itk_component(inputs) insert end $path -data [list Value $val] 228 } 229 $itk_component(inputs) open -recurse root 230 } 231 } 232 233 itcl::body Rappture::Tester::TestView::updateOutputs {args} { 234 $itk_component(outputs) delete 0 235 set test $itk_option(-test) 236 if {$test != "" && [$test hasRan] && [$test getResult] != "Error"} { 237 $itk_component(tabs) tab configure "Outputs" -state normal 238 foreach {path status} [$test getOutputs] { 239 $itk_component(outputs) insert end $path -data [list Status $status] 240 } 241 $itk_component(outputs) open -recurse root 242 } else { 243 $itk_component(tabs) tab configure "Outputs" -state disabled 244 # Switch back to results tab if the outputs tab is open and the 245 # selected test has not been ran. 246 if {[$itk_component(tabs) index select] == \ 247 [$itk_component(tabs) index -name "Outputs"]} { 248 set index [$itk_component(tabs) index -name "Results"] 249 $itk_component(tabs) select $index 250 $itk_component(tabs) focus $index 251 } 252 } 253 } 254 255 256
Note: See TracChangeset
for help on using the changeset viewer.