Changeset 2009 for trunk/tester/testview.tcl
- Timestamp:
- Dec 16, 2010, 8:58:11 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tester/testview.tcl
r2008 r2009 29 29 inherit itk::Widget 30 30 31 public method clear {} 32 public method showTest {testxml} 33 public method showResult {runfile} 34 public method showText {text} 31 private method clear {} 32 private method showTest {testxml} 33 private method showResult {runfile} 34 private method showStatus {text} 35 private method showDescription {text} 35 36 public method update {datapairs} 36 37 … … 48 49 [file dirname $toolxml]] 49 50 50 itk_component add txt{51 text $itk_interior.txt -height 151 itk_component add status { 52 label $itk_interior.status 52 53 } 53 pack $itk_component(txt) -expand no -fill x -side top 54 pack $itk_component(status) -expand no -fill none -side top -anchor w 55 56 itk_component add scroller { 57 Rappture::Scroller $itk_interior.scroller \ 58 -xscrollmode auto -yscrollmode auto 59 } 60 61 itk_component add description { 62 text $itk_interior.scroller.description -height 0 -wrap word \ 63 -relief flat 64 } 65 $itk_component(scroller) contents $itk_component(description) 66 pack $itk_component(scroller) -expand no -fill x -side top 54 67 55 68 itk_component add analyzer1 { … … 81 94 catch {destroy $itk_component(analyzer1)} 82 95 catch {destroy $itk_component(analyzer2)} 83 $itk_component(txt) delete 0.0 end 96 showStatus "" 97 showDescription "" 84 98 } 85 99 … … 96 110 Rappture::Tester::TestAnalyzer $itk_interior.analyzer1 $_toolobj 97 111 } 98 pack $itk_component(analyzer1) -expand no -fill both -side top 112 pack $itk_component(analyzer1) -expand no -fill both -side top \ 113 -after $itk_component(scroller) 99 114 $itk_component(analyzer1) display $testxml 100 115 } … … 112 127 Rappture::Tester::TestAnalyzer $itk_interior.analyzer2 $_toolobj 113 128 } 114 pack $itk_component(analyzer2) -expand no -fill both -side top 129 pack $itk_component(analyzer2) -expand no -fill both -side top \ 130 -after $itk_component(analyzer1) 115 131 $itk_component(analyzer2) display $runfile 116 132 } 117 133 118 134 # ---------------------------------------------------------------------- 119 # USAGE: show Text<text>135 # USAGE: showStatus <text> 120 136 # 121 # Displays a string in the textspace at the top of the widget.137 # Displays a string in the status info space at the top of the widget. 122 138 # ---------------------------------------------------------------------- 123 itcl::body Rappture::Tester::TestView::showText {text} { 124 $itk_component(txt) configure -state normal 125 $itk_component(txt) delete 0.0 end 126 $itk_component(txt) insert end "$text" 127 $itk_component(txt) configure -state disabled 139 itcl::body Rappture::Tester::TestView::showStatus {text} { 140 $itk_component(status) configure -text "$text" 141 } 142 143 # ---------------------------------------------------------------------- 144 # USAGE: showDescription <text> 145 # 146 # Displays a string in the description text space near the top of the 147 # widget. If given an empty string, disable the sunken relief effect 148 # to partially hide the text box. 149 # ---------------------------------------------------------------------- 150 itcl::body Rappture::Tester::TestView::showDescription {text} { 151 $itk_component(description) configure -state normal 152 $itk_component(description) delete 0.0 end 153 $itk_component(description) insert end "$text" 154 $itk_component(description) configure -state disabled 155 if {$text == ""} { 156 $itk_component(description) configure -relief flat 157 } else { 158 $itk_component(description) configure -relief sunken 159 } 128 160 } 129 161 … … 145 177 if {$data(ran)} { 146 178 switch $data(result) { 147 Pass {show Text"Test passed."}148 Fail {show Text "Diffs: $data(diffs)"}149 Error {show Text"Error while running test."}179 Pass {showStatus "Test passed."} 180 Fail {showStatus "Test failed."} 181 Error {showStatus "Error while running test."} 150 182 } 151 183 if {$data(runfile) != ""} { … … 154 186 } 155 187 } else { 156 show Text"Test has not yet ran."188 showStatus "Test has not yet ran." 157 189 } 190 set descr [[Rappture::library $data(testxml)] get test.description] 191 if {$descr == ""} { 192 set descr "No description." 193 } 194 showDescription $descr 158 195 } 159 196 }
Note: See TracChangeset
for help on using the changeset viewer.