Changeset 2012 for trunk/tester/testview.tcl
- Timestamp:
- Dec 17, 2010, 2:50:25 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tester/testview.tcl
r2011 r2012 14 14 # ====================================================================== 15 15 package require Itk 16 package require BLT 16 17 17 18 namespace eval Rappture::Tester::TestView { #forward declaration } … … 30 31 31 32 protected method updateAnalyzer {args} 32 protected method showResult {runfile}33 protected method updateResult {runfile} 33 34 protected method showStatus {text} 34 35 protected method showDescription {text} … … 73 74 } 74 75 $itk_component(tabs) insert end "Analyzer" -ipady 25 -fill both 75 $itk_component(tabs) insert end "Result" -ipady 25 -fill both 76 $itk_component(tabs) insert end "Result" -ipady 25 -fill both \ 77 -state disabled 76 78 pack $itk_component(tabs) -expand yes -fill both -side top 77 79 … … 100 102 # ---------------------------------------------------------------------- 101 103 itcl::body Rappture::Tester::TestView::clear {} { 102 catch { 103 $itk_component(analyzer) clear 104 destroy $itk_component(analyzer) 105 } 106 $itk_component(tabs) invoke [$itk_component(tabs) index -name "Result"] 104 updateAnalyzer 105 updateResult 106 # TODO: Switch back to analyzer tab when disabling result tab 107 $itk_component(tabs) focus [$itk_component(tabs) index -name "Analyzer"] 107 108 $itk_component(tabs) tab configure "Result" -state disabled 108 109 showStatus "" … … 114 115 # 115 116 # Clears the analyzer and loads the given library objects. Used to load 116 # both the golden result as well as the test result. 117 # both the golden result as well as the test result. Clears the 118 # analyzer space if no arguments are given. 117 119 # Destroys the existing analyzer widget and creates a new one. 118 120 # Eventually this should be able to keep the same widget and swap in … … 136 138 137 139 # ---------------------------------------------------------------------- 138 # TODO: fill this in 139 # ---------------------------------------------------------------------- 140 itcl::body Rappture::Tester::TestView::showResult {runfile} { 141 $itk_component(tabs) tab configure "Result" -state normal 142 $itk_component(result) delete 0.0 end 143 $itk_component(result) insert end $runfile 140 # USAGE: updateResult ?datapairs? 141 # 142 # Given a set of key value pairs from the test tree, update the result 143 # page of the testview widget. If no arguments are given, disable the 144 # result page. 145 # ---------------------------------------------------------------------- 146 itcl::body Rappture::Tester::TestView::updateResult {args} { 147 if {[llength $args] == 0} { 148 $itk_component(result) delete 0.0 end 149 $itk_component(tabs) focus [$itk_component(tabs) index -name "Result"] 150 $itk_component(tabs) tab configure "Result" -state disabled 151 return 152 } elseif {[llength $args] == 1} { 153 array set data [lindex $args 0] 154 $itk_component(tabs) tab configure "Result" -state normal 155 $itk_component(result) delete 0.0 end 156 $itk_component(result) insert end "Test xml: $data(testxml)\n" 157 $itk_component(result) insert end "Runfile: $data(runfile)\n" 158 if {$data(result) == "Fail"} { 159 $itk_component(result) insert end "Diffs: $data(diffs)\n" 160 } 161 } else { 162 error "wrong # args: should be \"updateResult ?datapairs?\"" 163 } 144 164 } 145 165 … … 197 217 $result put input.run.current "Test" 198 218 updateAnalyzer $golden $result 199 showResult $data(runfile) 219 updateResult $datapairs 220 } else { 221 updateResult 200 222 } 201 223 } else { 202 224 showStatus "Test has not yet ran." 225 updateResult 203 226 if {$data(testxml) != ""} { 204 227 updateAnalyzer [Rappture::library $data(testxml)] … … 211 234 showDescription $descr 212 235 } else { 213 # clear e ntire screenif branch node selected214 #clear215 } 216 } 217 236 # clear everything if branch node selected 237 clear 238 } 239 } 240
Note: See TracChangeset
for help on using the changeset viewer.