author | Claus Gittinger <cg@exept.de> |
Mon, 10 Mar 2008 10:26:30 +0100 | |
changeset 178 | 31e594125d95 |
parent 122 | 61e456491017 |
child 182 | 6a3efe4da033 |
permissions | -rw-r--r-- |
0 | 1 |
"{ Package: 'stx:goodies/sunit' }" |
2 |
||
3 |
ApplicationModel subclass:#TestRunner |
|
64 | 4 |
instanceVariableNames:'result lastTestCase lastPass defect allDefects defectMenu details |
5 |
mode scriptModel script numberOfTestsToRun testsWhichFailed |
|
39 | 6 |
testsWhichPassed categoryModel category' |
30 | 7 |
classVariableNames:'' |
8 |
poolDictionaries:'' |
|
9 |
category:'SUnit-UI' |
|
0 | 10 |
! |
11 |
||
43 | 12 |
!TestRunner class methodsFor:'documentation'! |
13 |
||
14 |
documentation |
|
15 |
" |
|
16 |
This GUI is based on SUnit2.7 and |
|
17 |
was ported to ST/X by Samuel S. Schuster (as 2.7) (thanks, indeed) |
|
18 |
||
19 |
It was slightly enhanced by adding a rerun-defects, browse and |
|
20 |
a category selector (to minor revision 2.7d, in the meantime) |
|
21 |
" |
|
22 |
! ! |
|
11 | 23 |
|
8 | 24 |
!TestRunner class methodsFor:'defaults'! |
25 |
||
42 | 26 |
colorForFailedTests |
27 |
^ Color red |
|
28 |
! |
|
29 |
||
30 |
colorForPassedTests |
|
31 |
^ Color green darkened |
|
32 |
! |
|
33 |
||
8 | 34 |
defaultIcon |
78 | 35 |
<resource: #programImage> |
8 | 36 |
|
78 | 37 |
"/ kept there to prevent me from being autoloaded for the icon |
38 |
^ ToolbarIconLibrary sUnit28x28Icon |
|
8 | 39 |
! ! |
40 |
||
0 | 41 |
!TestRunner class methodsFor:'interface specs'! |
42 |
||
48 | 43 |
flyByHelpSpec |
44 |
<resource: #help> |
|
45 |
||
46 |
^super flyByHelpSpec addPairsFrom:#( |
|
47 |
||
48 |
#refreshSuitesButton |
|
49 |
'Refresh List of Tests' |
|
50 |
||
51 |
#suitesCategoryList |
|
52 |
'Test Categories' |
|
53 |
||
54 |
#suiteSelection |
|
55 |
'Selected Test' |
|
56 |
||
57 |
#runButton |
|
58 |
'Run selected Test' |
|
59 |
||
60 |
#rerunDefectsButton |
|
61 |
'ReRun Defects Only' |
|
62 |
||
63 |
#runAllButton |
|
64 |
'Run all Tests from Category' |
|
65 |
||
66 |
#defectsList |
|
67 |
'Failures' |
|
68 |
||
69 |
#browseButton |
|
70 |
'Browse Test' |
|
71 |
||
72 |
#debugButton |
|
73 |
'Debug Failed Test' |
|
74 |
||
75 |
) |
|
76 |
! |
|
77 |
||
0 | 78 |
windowSpec |
79 |
"This resource specification was automatically generated |
|
80 |
by the UIPainter of ST/X." |
|
81 |
||
82 |
"Do not manually edit this!! If it is corrupted, |
|
83 |
the UIPainter may not be able to read the specification." |
|
84 |
||
85 |
" |
|
86 |
UIPainter new openOnClass:TestRunner andSelector:#windowSpec |
|
87 |
TestRunner new openInterface:#windowSpec |
|
88 |
TestRunner open |
|
89 |
" |
|
90 |
||
91 |
<resource: #canvas> |
|
92 |
||
93 |
^ |
|
117
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
94 |
#(FullSpec |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
95 |
name: windowSpec |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
96 |
window: |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
97 |
(WindowSpec |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
98 |
label: 'SUnit Camp Smalltalk 3.1/STX TestRunner' |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
99 |
name: 'SUnit Camp Smalltalk 3.1/STX TestRunner' |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
100 |
min: (Point 362 122) |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
101 |
bounds: (Rectangle 0 0 493 175) |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
102 |
icon: defaultIcon |
39 | 103 |
) |
117
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
104 |
component: |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
105 |
(SpecCollection |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
106 |
collection: ( |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
107 |
(ActionButtonSpec |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
108 |
label: 'Refresh' |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
109 |
name: 'RefreshButton' |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
110 |
layout: (LayoutFrame 0 0 0 0 75 0 48 0) |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
111 |
activeHelpKey: refreshSuitesButton |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
112 |
tabable: true |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
113 |
model: refreshSuites |
39 | 114 |
) |
117
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
115 |
(MenuButtonSpec |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
116 |
name: 'category' |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
117 |
layout: (LayoutFrame 76 0 0 0 -216 1 24 0) |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
118 |
activeHelpKey: suitesCategoryList |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
119 |
tabable: true |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
120 |
model: category |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
121 |
menu: categoryList |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
122 |
) |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
123 |
(MenuButtonSpec |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
124 |
name: tests |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
125 |
layout: (LayoutFrame 76 0 24 0 -216 1 48 0) |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
126 |
activeHelpKey: suiteSelection |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
127 |
tabable: true |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
128 |
model: script |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
129 |
menu: scriptModel |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
130 |
useIndex: true |
39 | 131 |
) |
117
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
132 |
(ActionButtonSpec |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
133 |
label: 'Run' |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
134 |
name: 'RunButton' |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
135 |
layout: (LayoutFrame -215 1 0 0 -160 1 48 0) |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
136 |
activeHelpKey: runButton |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
137 |
tabable: true |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
138 |
model: runTests |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
139 |
enableChannel: enableRunButton |
39 | 140 |
) |
117
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
141 |
(ActionButtonSpec |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
142 |
label: 'ReRun Defects' |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
143 |
name: 'ReRunButton' |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
144 |
layout: (LayoutFrame -159 1 0 0 -57 1 48 0) |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
145 |
activeHelpKey: rerunDefectsButton |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
146 |
tabable: true |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
147 |
model: runDefects |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
148 |
enableChannel: enableDefects |
39 | 149 |
) |
117
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
150 |
(ActionButtonSpec |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
151 |
label: 'Run All' |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
152 |
name: 'RunAllButton' |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
153 |
layout: (LayoutFrame -56 1 0 0 0 1 48 0) |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
154 |
activeHelpKey: runAllButton |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
155 |
tabable: true |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
156 |
model: runAllTests |
39 | 157 |
) |
117
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
158 |
(ProgressIndicatorSpec |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
159 |
name: 'ProgressIndicator1' |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
160 |
layout: (LayoutFrame 0 0.0 49 0 0 1.0 60 0) |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
161 |
visibilityChannel: percentageIndicatorVisible |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
162 |
model: percentageDone |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
163 |
foregroundColor: (Color 32.999160753796 32.999160753796 0.0) |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
164 |
backgroundColor: (Color 66.999313344015 66.999313344015 0.0) |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
165 |
showPercentage: false |
39 | 166 |
) |
117
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
167 |
(LabelSpec |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
168 |
label: '...' |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
169 |
name: 'details' |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
170 |
layout: (LayoutFrame 0 0 21 0.5 0 1 -25 1) |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
171 |
labelChannel: details |
51 | 172 |
) |
117
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
173 |
(LabelSpec |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
174 |
label: 'N/A' |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
175 |
name: 'mode' |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
176 |
layout: (LayoutFrame 0 0 49 0 0 1 35 0.5) |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
177 |
style: (FontDescription Arial bold roman 14) |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
178 |
labelChannel: mode |
39 | 179 |
) |
117
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
180 |
(MenuButtonSpec |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
181 |
name: defects |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
182 |
layout: (LayoutFrame 0 0 -24 1 -152 1 0 1) |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
183 |
isOpaque: true |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
184 |
flags: 40 |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
185 |
activeHelpKey: defectsList |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
186 |
tabable: true |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
187 |
model: selectionHolder |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
188 |
initiallyDisabled: true |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
189 |
enableChannel: enableDefects |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
190 |
menu: defectMenu |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
191 |
ignoreReselect: false |
39 | 192 |
) |
117
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
193 |
(ActionButtonSpec |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
194 |
label: 'Browse' |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
195 |
name: 'BrowseButton' |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
196 |
layout: (LayoutFrame -151 1 -24 1 -76 1 0 1) |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
197 |
activeHelpKey: browseButton |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
198 |
tabable: true |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
199 |
model: browseSelectedTestCase |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
200 |
initiallyDisabled: true |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
201 |
enableChannel: enableRunButton |
39 | 202 |
) |
117
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
203 |
(ActionButtonSpec |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
204 |
label: 'Debug' |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
205 |
name: 'DebugButton' |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
206 |
layout: (LayoutFrame -75 1 -24 1 0 1 0 1) |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
207 |
activeHelpKey: debugButton |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
208 |
tabable: true |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
209 |
model: debugSelectedFailure |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
210 |
initiallyDisabled: true |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
211 |
enableChannel: enableDebugButton |
39 | 212 |
) |
213 |
) |
|
0 | 214 |
|
39 | 215 |
) |
0 | 216 |
) |
217 |
! ! |
|
218 |
||
219 |
!TestRunner class methodsFor:'opening'! |
|
220 |
||
221 |
open |
|
222 |
||
30 | 223 |
^super open |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
224 |
! |
5 | 225 |
|
226 |
openOnTestCase:aTestCaseSubclass |
|
76
4caa8b4f31d1
immediately run tests when started on a specified testCase
Claus Gittinger <cg@exept.de>
parents:
75
diff
changeset
|
227 |
"open the testrunner,let it switch to and execute a testcase" |
4caa8b4f31d1
immediately run tests when started on a specified testCase
Claus Gittinger <cg@exept.de>
parents:
75
diff
changeset
|
228 |
|
106 | 229 |
|runner| |
5 | 230 |
|
231 |
runner := self new. |
|
76
4caa8b4f31d1
immediately run tests when started on a specified testCase
Claus Gittinger <cg@exept.de>
parents:
75
diff
changeset
|
232 |
runner openAndWaitUntilVisible. |
4caa8b4f31d1
immediately run tests when started on a specified testCase
Claus Gittinger <cg@exept.de>
parents:
75
diff
changeset
|
233 |
|
4caa8b4f31d1
immediately run tests when started on a specified testCase
Claus Gittinger <cg@exept.de>
parents:
75
diff
changeset
|
234 |
"/ idx := runner scriptModel value indexOf:aTestCaseSubclass name. |
4caa8b4f31d1
immediately run tests when started on a specified testCase
Claus Gittinger <cg@exept.de>
parents:
75
diff
changeset
|
235 |
runner selectScriptNamed:aTestCaseSubclass name. |
15 | 236 |
|
76
4caa8b4f31d1
immediately run tests when started on a specified testCase
Claus Gittinger <cg@exept.de>
parents:
75
diff
changeset
|
237 |
"/ the test should be executed by the TestRunner process (not the caller) |
4caa8b4f31d1
immediately run tests when started on a specified testCase
Claus Gittinger <cg@exept.de>
parents:
75
diff
changeset
|
238 |
"/ in oder for CTRL-C and busyCursor to work correctly. |
4caa8b4f31d1
immediately run tests when started on a specified testCase
Claus Gittinger <cg@exept.de>
parents:
75
diff
changeset
|
239 |
"/ Therefore, push event instead of executing the test here. |
4caa8b4f31d1
immediately run tests when started on a specified testCase
Claus Gittinger <cg@exept.de>
parents:
75
diff
changeset
|
240 |
|
4caa8b4f31d1
immediately run tests when started on a specified testCase
Claus Gittinger <cg@exept.de>
parents:
75
diff
changeset
|
241 |
"/runner runTests |
4caa8b4f31d1
immediately run tests when started on a specified testCase
Claus Gittinger <cg@exept.de>
parents:
75
diff
changeset
|
242 |
runner enqueueMessage:#runTests for:runner arguments:nil. |
5 | 243 |
|
244 |
" |
|
245 |
self openOnTestCase:CompilerTest |
|
76
4caa8b4f31d1
immediately run tests when started on a specified testCase
Claus Gittinger <cg@exept.de>
parents:
75
diff
changeset
|
246 |
self openOnTestCase:ConstraintTests |
5 | 247 |
" |
248 |
! ! |
|
0 | 249 |
|
250 |
!TestRunner class methodsFor:'plugIn spec'! |
|
251 |
||
252 |
aspectSelectors |
|
253 |
"This resource specification was automatically generated |
|
254 |
by the UIPainter of ST/X." |
|
255 |
||
256 |
"Do not manually edit this. If it is corrupted, |
|
257 |
the UIPainter may not be able to read the specification." |
|
258 |
||
259 |
"Return a description of exported aspects; |
|
260 |
these can be connected to aspects of an embedding application |
|
261 |
(if this app is embedded in a subCanvas)." |
|
262 |
||
263 |
^ #( |
|
39 | 264 |
#script |
0 | 265 |
). |
266 |
||
267 |
! ! |
|
268 |
||
68 | 269 |
!TestRunner methodsFor:'accessing'! |
0 | 270 |
|
39 | 271 |
category |
272 |
|holder| |
|
273 |
||
274 |
(holder := builder bindingAt:#category) isNil ifTrue:[ |
|
275 |
holder := '* all *' asValue. |
|
276 |
builder aspectAt:#category put:holder. |
|
277 |
holder onChangeSend:#categorySelectionChanged to:self. |
|
278 |
]. |
|
279 |
^ holder. |
|
280 |
! |
|
281 |
||
282 |
categoryList |
|
283 |
^categoryModel isNil |
|
284 |
ifTrue: [categoryModel := ValueHolder new. self updateCategoryList. categoryModel] |
|
285 |
ifFalse: [categoryModel] |
|
286 |
! |
|
287 |
||
0 | 288 |
defectMenu |
289 |
"automatically generated by UIPainter ..." |
|
290 |
||
291 |
"*** the code below creates a default model when invoked." |
|
292 |
"*** (which may not be the one you wanted)" |
|
293 |
"*** Please change as required and accept it in the browser." |
|
294 |
||
295 |
^defectMenu isNil |
|
30 | 296 |
ifTrue: [defectMenu := OrderedCollection new asValue] |
297 |
ifFalse: [defectMenu] |
|
0 | 298 |
|
299 |
"Modified: / 4.4.2000 / 20:00:31 / Sames" |
|
300 |
! |
|
301 |
||
302 |
defects |
|
303 |
||
30 | 304 |
^self builder componentAt: #defects |
0 | 305 |
|
306 |
"Created: / 21.6.2000 / 12:19:29 / Sames" |
|
307 |
! |
|
308 |
||
309 |
details |
|
106 | 310 |
"This method was generated by UIDefiner. Any edits made here |
311 |
may be lost whenever methods are automatically defined. The |
|
312 |
initialization provided below may have been preempted by an |
|
313 |
initialize method." |
|
0 | 314 |
|
106 | 315 |
^details isNil |
316 |
ifTrue: |
|
317 |
[details := '...' asValue] |
|
318 |
ifFalse: |
|
319 |
[details] |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
320 |
! |
0 | 321 |
|
322 |
mode |
|
30 | 323 |
"This method was generated by UIDefiner. Any edits made here |
324 |
may be lost whenever methods are automatically defined. The |
|
325 |
initialization provided below may have been preempted by an |
|
326 |
initialize method." |
|
0 | 327 |
|
30 | 328 |
^mode isNil |
329 |
ifTrue: |
|
330 |
[mode := 'N/A' asValue] |
|
331 |
ifFalse: |
|
332 |
[mode] |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
333 |
! |
0 | 334 |
|
19 | 335 |
percentageDone |
178 | 336 |
^ builder valueAspectFor:#percentageDone initialValue:0 |
19 | 337 |
! |
338 |
||
339 |
percentageIndicatorVisible |
|
178 | 340 |
^ builder valueAspectFor:#percentageIndicatorVisible initialValue:false |
19 | 341 |
! |
342 |
||
0 | 343 |
script |
344 |
"automatically generated by UIPainter ..." |
|
345 |
||
346 |
"*** the code below creates a default model when invoked." |
|
347 |
"*** (which may not be the one you wanted)" |
|
348 |
"*** Please change as required and accept it in the browser." |
|
349 |
||
55 | 350 |
script isNil ifTrue:[ |
351 |
script := ValueHolder new. |
|
352 |
script onChangeSend:#suiteSelectionChanged to:self. |
|
0 | 353 |
]. |
55 | 354 |
^ script. |
0 | 355 |
|
356 |
"Created: / 21.6.2000 / 12:04:36 / Sames" |
|
357 |
! |
|
358 |
||
359 |
script:something |
|
360 |
"automatically generated by UIPainter ..." |
|
361 |
||
362 |
"This method is used when I am embedded as subApplication," |
|
363 |
"and the mainApp wants to connect its aspects to mine." |
|
364 |
||
365 |
"/ |holder| |
|
366 |
||
367 |
"/ (holder := builder bindingAt:#script) notNil ifTrue:[ |
|
368 |
"/ holder removeDependent:self. |
|
369 |
"/ ]. |
|
370 |
builder aspectAt:#script put:something. |
|
371 |
"/ something notNil ifTrue:[ |
|
372 |
"/ something addDependent:self. |
|
373 |
"/ ]. |
|
374 |
^ self. |
|
375 |
||
376 |
"Created: / 21.6.2000 / 12:04:36 / Sames" |
|
377 |
! |
|
378 |
||
379 |
scriptModel |
|
380 |
"This method was generated by UIDefiner. Any edits made here |
|
28 | 381 |
may be lost whenever methods are automatically defined. The |
382 |
initialization provided below may have been preempted by an |
|
383 |
initialize method." |
|
0 | 384 |
|
385 |
^scriptModel isNil |
|
28 | 386 |
ifTrue: [scriptModel := ValueHolder new. self updateSuitesList. scriptModel] |
387 |
ifFalse: [scriptModel] |
|
0 | 388 |
|
389 |
"Modified: / 2.4.2000 / 14:37:51 / Sames" |
|
390 |
! |
|
391 |
||
392 |
selection |
|
393 |
||
30 | 394 |
^defect |
0 | 395 |
|
396 |
"Created: / 4.4.2000 / 18:50:55 / Sames" |
|
397 |
! |
|
398 |
||
399 |
selectionHolder |
|
400 |
||
401 |
|holder| |
|
402 |
||
403 |
(holder := builder bindingAt:#selectionHolder) isNil ifTrue:[ |
|
117
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
404 |
holder := AspectAdaptor new subject:self; forAspect:#selection. |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
405 |
builder aspectAt:#selectionHolder put:holder. |
0 | 406 |
]. |
407 |
^ holder. |
|
408 |
||
409 |
"Created: / 4.4.2000 / 18:46:08 / Sames" |
|
410 |
"Modified: / 4.4.2000 / 18:47:31 / Sames" |
|
411 |
! |
|
412 |
||
413 |
tests |
|
414 |
||
30 | 415 |
^self builder componentAt: #tests |
0 | 416 |
|
417 |
"Created: / 4.4.2000 / 19:57:37 / Sames" |
|
418 |
! ! |
|
419 |
||
68 | 420 |
!TestRunner methodsFor:'actions'! |
0 | 421 |
|
10 | 422 |
browseSelectedTestCase |
75 | 423 |
|testCaseName testCase browser defect singleCase| |
10 | 424 |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
425 |
testCaseName := self selectedScript. |
115 | 426 |
testCaseName isNil ifTrue:[ |
427 |
testCaseName := self tests contents. |
|
428 |
testCaseName notNil ifTrue:[ |
|
429 |
testCaseName := testCaseName string |
|
430 |
] |
|
431 |
]. |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
432 |
testCaseName notNil ifTrue:[ |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
433 |
testCase := Smalltalk at:testCaseName asSymbol. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
434 |
testCase notNil ifTrue:[ |
51 | 435 |
browser := UserPreferences current systemBrowserClass openInClass:testCase. |
436 |
MessageNotUnderstood |
|
437 |
handle:[:ex | ] |
|
75 | 438 |
do:[ |
439 |
(defect := self selection) notNil ifTrue:[ |
|
440 |
singleCase := allDefects at:defect ifAbsent: [nil]. |
|
441 |
]. |
|
442 |
singleCase notNil ifTrue:[ |
|
443 |
browser switchToSelector:singleCase selector |
|
444 |
] ifFalse:[ |
|
445 |
browser selectProtocolsMatching:'test*' |
|
446 |
] |
|
447 |
] |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
448 |
] |
10 | 449 |
] |
450 |
! |
|
451 |
||
39 | 452 |
categorySelectionChanged |
60 | 453 |
|selectedScriptIndex selectedScript oldSuitesList newSuitesList |
454 |
newScriptSelectionIndex| |
|
55 | 455 |
|
456 |
selectedScriptIndex := self script value. |
|
457 |
oldSuitesList := self scriptModel value. |
|
458 |
||
459 |
selectedScriptIndex notNil ifTrue:[ |
|
460 |
selectedScript := (oldSuitesList at:selectedScriptIndex) string |
|
461 |
]. |
|
462 |
||
463 |
self updateSuitesList. |
|
464 |
||
465 |
newSuitesList := self scriptModel value. |
|
60 | 466 |
newScriptSelectionIndex := newSuitesList indexOf:selectedScript. |
467 |
||
468 |
self script value:(newScriptSelectionIndex == 0 |
|
469 |
ifTrue:[nil] |
|
470 |
ifFalse:[newScriptSelectionIndex]). |
|
39 | 471 |
! |
472 |
||
0 | 473 |
debugSelectedFailure |
106 | 474 |
self debugTest: self selection |
0 | 475 |
|
476 |
"Created: / 21.6.2000 / 10:58:58 / Sames" |
|
477 |
"Modified: / 21.6.2000 / 12:21:05 / Sames" |
|
478 |
! |
|
479 |
||
480 |
debugTest: aTestCaseName |
|
481 |
| testCase | |
|
29
ada4e34e33ec
allow reselecting in defect-popUpList
Claus Gittinger <cg@exept.de>
parents:
28
diff
changeset
|
482 |
|
0 | 483 |
defect := aTestCaseName. |
484 |
testCase := allDefects at: aTestCaseName ifAbsent: [nil]. |
|
485 |
testCase isNil ifTrue: [^self enableDebugButton value: false]. |
|
75 | 486 |
|
0 | 487 |
self enableDebugButton value: true. |
488 |
self displayMode: 'Debugging'. |
|
489 |
||
75 | 490 |
"/ defect := nil. |
491 |
||
99 | 492 |
self withWaitCursorDo:[ |
493 |
((result isFailure: testCase) "or:[(result isError: testCase)]") |
|
494 |
ifTrue: [testCase debugAsFailure] |
|
495 |
ifFalse: [testCase debug]. |
|
496 |
]. |
|
75 | 497 |
|
0 | 498 |
"Modified: / 21.6.2000 / 12:12:09 / Sames" |
499 |
! |
|
500 |
||
501 |
enableDebugButton |
|
178 | 502 |
^ builder valueAspectFor:#enableDebugButton initialValue:false |
0 | 503 |
|
504 |
"Created: / 21.6.2000 / 10:47:34 / Sames" |
|
505 |
"Modified: / 21.6.2000 / 10:51:07 / Sames" |
|
506 |
! |
|
507 |
||
117
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
508 |
enableDefects |
178 | 509 |
^ builder valueAspectFor:#enableDefects initialValue:true |
0 | 510 |
! |
511 |
||
512 |
enableRunButton |
|
178 | 513 |
^ builder valueAspectFor:#enableRunButton initialValue:true |
0 | 514 |
|
515 |
"Created: / 21.6.2000 / 10:47:34 / Sames" |
|
516 |
! |
|
517 |
||
518 |
refreshSuites |
|
39 | 519 |
self updateCategoryList. |
520 |
self updateSuitesList. |
|
521 |
||
522 |
self script value:nil. |
|
523 |
self tests selection: 0. |
|
524 |
self defects selection: 0. |
|
525 |
result := TestResult new. |
|
64 | 526 |
lastTestCase := nil. |
39 | 527 |
self displayRefresh |
0 | 528 |
|
529 |
"Created: / 21.6.2000 / 10:58:34 / Sames" |
|
530 |
"Modified: / 21.6.2000 / 12:19:54 / Sames" |
|
531 |
! |
|
532 |
||
75 | 533 |
rerunSingleSelectedTestCase |
534 |
self debugTest:self defects contents |
|
535 |
! |
|
536 |
||
0 | 537 |
runAllTests |
30 | 538 |
self runSuite: self allTestSuite |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
539 |
! |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
540 |
|
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
541 |
runDefectTests |
30 | 542 |
| testSuite | |
543 |
(testSuite := self defectTestSuite) notNil ifTrue: |
|
544 |
[self runSuite: testSuite] |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
545 |
! |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
546 |
|
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
547 |
runDefects |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
548 |
allDefects size > 0 ifTrue:[ |
30 | 549 |
^ self runDefectTests |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
550 |
]. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
551 |
self runTests |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
552 |
! |
0 | 553 |
|
554 |
runSuite: aTestSuite |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
555 |
|numTests| |
19 | 556 |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
557 |
"/ count the number of individual tests |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
558 |
numTests := 0. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
559 |
aTestSuite tests do:[:eachTestOrSubSuite | |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
560 |
(eachTestOrSubSuite isKindOf:TestSuite) ifTrue:[ |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
561 |
numTests := numTests + eachTestOrSubSuite tests size. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
562 |
] ifFalse:[ |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
563 |
numTests := numTests + 1. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
564 |
] |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
565 |
]. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
566 |
numberOfTestsToRun := numTests. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
567 |
self percentageDone value:0. |
19 | 568 |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
569 |
Cursor |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
570 |
wait |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
571 |
showWhile:[ |
39 | 572 |
|errorCountBefore failureCountBefore| |
573 |
||
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
574 |
self displayRunning. |
94 | 575 |
"/ self displayDetails: '...'. |
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
576 |
aTestSuite addDependentToHierachy: self. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
577 |
result := TestResult new. |
64 | 578 |
lastTestCase := aTestSuite. |
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
579 |
self showPercentageIndicator. |
25
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
580 |
|
39 | 581 |
errorCountBefore := result errorCount. |
582 |
failureCountBefore := result failureCount. |
|
583 |
||
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
584 |
[ |
122 | 585 |
|caseName| |
586 |
||
39 | 587 |
aTestSuite |
588 |
run:result |
|
122 | 589 |
beforeEachDo:[:eachCase :eachResult | |
590 |
caseName := eachCase testName. |
|
39 | 591 |
caseName size == 0 ifTrue:[self halt]. |
592 |
||
61
b9204f5672ae
show each cases selector as it is executed
Claus Gittinger <cg@exept.de>
parents:
60
diff
changeset
|
593 |
self displayDetails:(caseName , '...'). |
80 | 594 |
self testPassed:caseName |
61
b9204f5672ae
show each cases selector as it is executed
Claus Gittinger <cg@exept.de>
parents:
60
diff
changeset
|
595 |
] |
122 | 596 |
afterEachDo:[:eachCase :eachResult | |
597 |
|passed errorCountAfter failureCountAfter| |
|
61
b9204f5672ae
show each cases selector as it is executed
Claus Gittinger <cg@exept.de>
parents:
60
diff
changeset
|
598 |
|
39 | 599 |
errorCountAfter := result errorCount. |
600 |
failureCountAfter := result failureCount. |
|
601 |
passed := (errorCountAfter == errorCountBefore) |
|
602 |
& (failureCountAfter == failureCountBefore). |
|
603 |
||
604 |
passed == true ifTrue:[ |
|
70 | 605 |
"/ testsWhichPassed add:caseName. |
606 |
"/ testsWhichFailed remove:caseName ifAbsent:nil. |
|
39 | 607 |
] ifFalse:[ |
87
24e88e7f5d88
remember individual failed cases.
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
608 |
self testFailed:caseName withResult:result |
39 | 609 |
]. |
610 |
errorCountBefore := errorCountAfter. |
|
611 |
failureCountBefore := failureCountAfter |
|
612 |
] |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
613 |
] ensure: [ |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
614 |
aTestSuite removeDependentFromHierachy: self. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
615 |
self hidePercentageIndicator. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
616 |
self displayNormalColorInProgress. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
617 |
]. |
70 | 618 |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
619 |
self updateWindow |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
620 |
] |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
621 |
! |
0 | 622 |
|
623 |
runTests |
|
30 | 624 |
| testSuite | |
625 |
(testSuite := self freshTestSuite) notNil ifTrue: |
|
626 |
[self runSuite: testSuite] |
|
0 | 627 |
|
628 |
"Modified: / 2.4.2000 / 14:16:10 / Sames" |
|
629 |
! |
|
630 |
||
11 | 631 |
scriptSelectionChanged |
15 | 632 |
self enableRunButton value:(self script value notNil). |
11 | 633 |
! |
634 |
||
0 | 635 |
selection: aValue |
636 |
||
117
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
637 |
aValue = '' ifTrue:[ |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
638 |
defect := aValue. |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
639 |
] ifFalse:[ |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
640 |
self debugTest: aValue |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
641 |
]. |
0 | 642 |
|
643 |
"Created: / 4.4.2000 / 18:54:09 / Sames" |
|
644 |
"Modified: / 4.4.2000 / 19:01:33 / Sames" |
|
645 |
! |
|
646 |
||
647 |
suiteSelectionChanged |
|
8 | 648 |
|ok className description cls| |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
649 |
|
121 | 650 |
ok := self freshTestSuite notNil and:[self script value notNil]. |
651 |
"/ self enableRunButton value:ok. |
|
652 |
self enableRunButton value:self script value notNil. |
|
117
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
653 |
self enableDefects value:(ok and:[allDefects size > 0]). |
0 | 654 |
|
8 | 655 |
self script value notNil ifTrue:[ |
42 | 656 |
className := self selectedScript string. |
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
657 |
(ok and:[className notNil]) ifTrue:[ |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
658 |
cls := Smalltalk at:className. |
65
019891d527b7
implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents:
64
diff
changeset
|
659 |
(cls class includesSelector:#description) ifTrue:[ |
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
660 |
description := cls description. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
661 |
] |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
662 |
]. |
8 | 663 |
]. |
17 | 664 |
self displayDetails:nil. |
665 |
self displayMode: (description ? ''). |
|
666 |
self displayGray. |
|
8 | 667 |
|
0 | 668 |
"Created: / 21.6.2000 / 11:31:25 / Sames" |
669 |
"Modified: / 21.6.2000 / 11:32:54 / Sames" |
|
24
0f897c4468c3
automatic update, when new testCase classes arrive,
Claus Gittinger <cg@exept.de>
parents:
23
diff
changeset
|
670 |
! |
0f897c4468c3
automatic update, when new testCase classes arrive,
Claus Gittinger <cg@exept.de>
parents:
23
diff
changeset
|
671 |
|
39 | 672 |
suitesInCategory |
673 |
|suites cat allCategories| |
|
674 |
||
675 |
cat := self category value. |
|
676 |
allCategories := (cat = '* all *'). |
|
677 |
||
678 |
suites := TestCase allSubclasses |
|
84 | 679 |
select:[:each | |
680 |
true "/ "cg:TestCaseHelper is gone -->" ((each isSubclassOf:TestCaseHelper) not) |
|
91
df3c9d5e7295
hide abstract testCase classes in testCase-list;
Claus Gittinger <cg@exept.de>
parents:
89
diff
changeset
|
681 |
and:[each isAbstract not |
df3c9d5e7295
hide abstract testCase classes in testCase-list;
Claus Gittinger <cg@exept.de>
parents:
89
diff
changeset
|
682 |
and:[allCategories or:[cat = each category]]]] |
39 | 683 |
thenCollect: [:each | each name]. |
684 |
suites sort. |
|
685 |
^ suites |
|
686 |
! |
|
687 |
||
688 |
updateCategoryList |
|
689 |
|categories| |
|
690 |
||
691 |
categories := (TestCase allSubclasses collect: [:each | each category]) asSet asOrderedCollection. |
|
692 |
categories sort. |
|
693 |
categories addFirst:'* all *'. |
|
694 |
self categoryList value:categories. |
|
695 |
! |
|
696 |
||
24
0f897c4468c3
automatic update, when new testCase classes arrive,
Claus Gittinger <cg@exept.de>
parents:
23
diff
changeset
|
697 |
updateSuitesList |
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
698 |
|suites| |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
699 |
|
39 | 700 |
suites := self suitesInCategory. |
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
701 |
suites := suites |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
702 |
collect:[:eachSuiteName | |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
703 |
(testsWhichFailed includes:eachSuiteName) ifTrue:[ |
42 | 704 |
eachSuiteName colorizeAllWith:(self class colorForFailedTests). |
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
705 |
] ifFalse:[ |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
706 |
(testsWhichPassed includes:eachSuiteName) ifTrue:[ |
42 | 707 |
eachSuiteName colorizeAllWith:(self class colorForPassedTests). |
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
708 |
] ifFalse:[ |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
709 |
eachSuiteName |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
710 |
] |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
711 |
]. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
712 |
]. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
713 |
self scriptModel value: suites. |
0 | 714 |
! ! |
715 |
||
68 | 716 |
!TestRunner methodsFor:'private'! |
0 | 717 |
|
80 | 718 |
addToFailedTests:caseName |
719 |
testsWhichFailed add:caseName. |
|
720 |
! |
|
721 |
||
722 |
addToPassedTests:caseName |
|
723 |
testsWhichPassed add:caseName. |
|
724 |
! |
|
725 |
||
0 | 726 |
allTestSuite |
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
727 |
"generate and return a suite for all tests, except SUnitTests" |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
728 |
|
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
729 |
| tokens stream suite| |
39 | 730 |
|
731 |
tokens := (self suitesInCategory |
|
732 |
collect: [:eachName | eachName ", '*' " ]) |
|
733 |
copyWithout: 'SUnitTest* '. |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
734 |
stream := WriteStream on: String new. |
39 | 735 |
tokens do: [:each | stream nextPutAll:each; space]. |
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
736 |
suite := TestSuitesScripter run: stream contents. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
737 |
suite name:'all'. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
738 |
^ suite |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
739 |
! |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
740 |
|
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
741 |
defectTestSuite |
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
742 |
|suite| |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
743 |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
744 |
suite := TestSuite new. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
745 |
suite name:'defects'. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
746 |
allDefects keysAndValuesDo:[:nm :test | |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
747 |
suite addTest:test. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
748 |
]. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
749 |
^suite |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
750 |
! |
0 | 751 |
|
752 |
formatTime: aTime |
|
30 | 753 |
aTime hours > 0 ifTrue: [^aTime hours printString , 'h']. |
754 |
aTime minutes > 0 ifTrue: [^aTime minutes printString , 'min']. |
|
755 |
^aTime seconds printString , ' sec' |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
756 |
! |
0 | 757 |
|
758 |
freshTestSuite |
|
94 | 759 |
|tests suite| |
0 | 760 |
|
98 | 761 |
tests := self tests contents. |
59 | 762 |
tests isNil ifTrue:[ ^ nil]. |
98 | 763 |
tests := tests string. |
94 | 764 |
suite := TestSuitesScripter run: tests. |
765 |
^ suite |
|
0 | 766 |
|
767 |
"Modified: / 4.4.2000 / 20:13:41 / Sames" |
|
768 |
! |
|
769 |
||
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
770 |
initialize |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
771 |
super initialize. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
772 |
|
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
773 |
testsWhichPassed := Set new. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
774 |
testsWhichFailed := Set new. |
83 | 775 |
|
776 |
TestCase allSubclassesDo:[:cls | |
|
87
24e88e7f5d88
remember individual failed cases.
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
777 |
|lastResult className| |
24e88e7f5d88
remember individual failed cases.
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
778 |
|
89
9f4e3bddee97
care for abstract testCase classes
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
779 |
cls isAbstract ifFalse:[ |
9f4e3bddee97
care for abstract testCase classes
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
780 |
lastResult := cls lastTestRunResultOrNil. |
9f4e3bddee97
care for abstract testCase classes
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
781 |
lastResult notNil ifTrue:[ |
9f4e3bddee97
care for abstract testCase classes
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
782 |
className := cls name. |
9f4e3bddee97
care for abstract testCase classes
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
783 |
lastResult == true ifTrue:[ |
9f4e3bddee97
care for abstract testCase classes
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
784 |
testsWhichPassed add:className |
9f4e3bddee97
care for abstract testCase classes
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
785 |
] ifFalse:[ |
9f4e3bddee97
care for abstract testCase classes
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
786 |
testsWhichFailed add:className |
9f4e3bddee97
care for abstract testCase classes
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
787 |
] |
83 | 788 |
] |
789 |
] |
|
790 |
]. |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
791 |
! |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
792 |
|
0 | 793 |
postOpenWith: aBuilder |
794 |
"automatically generated by UIPainter ..." |
|
795 |
||
796 |
super postOpenWith: aBuilder. |
|
797 |
self tests defaultLabel: ''. |
|
11 | 798 |
"/ self tests selection: 'ExampleSetTest'. self script value:1. |
15 | 799 |
|
800 |
self enableRunButton value: (self script value notNil). |
|
0 | 801 |
self enableDebugButton value: false. |
117
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
802 |
self enableDefects value: false. |
24
0f897c4468c3
automatic update, when new testCase classes arrive,
Claus Gittinger <cg@exept.de>
parents:
23
diff
changeset
|
803 |
self script onChangeSend: #suiteSelectionChanged to:self. |
0f897c4468c3
automatic update, when new testCase classes arrive,
Claus Gittinger <cg@exept.de>
parents:
23
diff
changeset
|
804 |
|
0f897c4468c3
automatic update, when new testCase classes arrive,
Claus Gittinger <cg@exept.de>
parents:
23
diff
changeset
|
805 |
Smalltalk addDependent:self. |
0 | 806 |
|
807 |
"Created: / 2.4.2000 / 14:44:32 / Sames" |
|
808 |
"Modified: / 21.6.2000 / 12:06:30 / Sames" |
|
809 |
! |
|
810 |
||
24
0f897c4468c3
automatic update, when new testCase classes arrive,
Claus Gittinger <cg@exept.de>
parents:
23
diff
changeset
|
811 |
release |
0f897c4468c3
automatic update, when new testCase classes arrive,
Claus Gittinger <cg@exept.de>
parents:
23
diff
changeset
|
812 |
Smalltalk removeDependent:self. |
0f897c4468c3
automatic update, when new testCase classes arrive,
Claus Gittinger <cg@exept.de>
parents:
23
diff
changeset
|
813 |
super release. |
0f897c4468c3
automatic update, when new testCase classes arrive,
Claus Gittinger <cg@exept.de>
parents:
23
diff
changeset
|
814 |
! |
0f897c4468c3
automatic update, when new testCase classes arrive,
Claus Gittinger <cg@exept.de>
parents:
23
diff
changeset
|
815 |
|
80 | 816 |
removeFromFailedTests:caseName |
817 |
testsWhichFailed remove:caseName ifAbsent:nil. |
|
818 |
! |
|
819 |
||
820 |
removeFromPassedTests:caseName |
|
821 |
testsWhichPassed remove:caseName ifAbsent:nil. |
|
822 |
! |
|
823 |
||
60 | 824 |
selectScriptNamed:aScriptName |
825 |
|idx scriptClass| |
|
826 |
||
827 |
idx := self scriptModel value indexOf:aScriptName. |
|
828 |
self script value:idx. |
|
829 |
||
830 |
self updateCategoryList. |
|
831 |
||
832 |
scriptClass := Smalltalk at:aScriptName asSymbol. |
|
833 |
scriptClass notNil ifTrue:[ |
|
834 |
self category value:scriptClass category. |
|
835 |
] |
|
836 |
! |
|
837 |
||
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
838 |
selectedScript |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
839 |
|scriptIndex| |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
840 |
|
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
841 |
scriptIndex := self script value. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
842 |
scriptIndex isNil ifTrue:[ |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
843 |
^ '' |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
844 |
]. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
845 |
^ self scriptModel value at:scriptIndex ifAbsent:nil. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
846 |
! |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
847 |
|
87
24e88e7f5d88
remember individual failed cases.
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
848 |
testFailed:caseName withResult:result |
80 | 849 |
|cls| |
88 | 850 |
|
80 | 851 |
self removeFromPassedTests:caseName. |
852 |
self addToFailedTests:caseName. |
|
853 |
||
854 |
(cls := Smalltalk classNamed:caseName) notNil ifTrue:[ |
|
87
24e88e7f5d88
remember individual failed cases.
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
855 |
cls rememberFailedTestRunWithResult:result. |
80 | 856 |
]. |
857 |
! |
|
858 |
||
859 |
testPassed:caseName |
|
860 |
|cls| |
|
861 |
||
862 |
self removeFromFailedTests:caseName. |
|
863 |
self addToPassedTests:caseName. |
|
864 |
||
85 | 865 |
"/ Transcript show:'passed: '; showCR:caseName. |
866 |
"/ Transcript show:'passed: '; showCR:caseName className. |
|
80 | 867 |
|
868 |
(cls := Smalltalk classNamed:caseName) notNil ifTrue:[ |
|
869 |
cls rememberPassedTestRun |
|
870 |
]. |
|
871 |
! |
|
872 |
||
0 | 873 |
timeSinceLastPassAsString |
30 | 874 |
lastPass isNil ifTrue: [^'']. |
875 |
^', ' , (self formatTime: (Time now subtractTime: lastPass getSeconds)) , ' since last Pass' |
|
0 | 876 |
|
877 |
"Modified: / 3.4.2000 / 19:17:11 / Sames" |
|
878 |
! ! |
|
879 |
||
68 | 880 |
!TestRunner methodsFor:'updating'! |
0 | 881 |
|
882 |
displayColor: aColorValue |
|
883 |
||
30 | 884 |
(builder componentAt: #mode) widget insideColor: aColorValue. |
885 |
(builder componentAt: #details) widget insideColor: aColorValue. |
|
0 | 886 |
|
887 |
"Modified: / 2.4.2000 / 14:21:42 / Sames" |
|
888 |
! |
|
889 |
||
890 |
displayDefault |
|
30 | 891 |
self displayColor: self tests backgroundColor |
0 | 892 |
|
893 |
"Created: / 21.6.2000 / 12:28:06 / Sames" |
|
894 |
"Modified: / 21.6.2000 / 12:35:09 / Sames" |
|
895 |
! |
|
896 |
||
897 |
displayDefects: aCollection |
|
117
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
898 |
| failedTests| |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
899 |
aCollection isEmpty ifTrue: [ |
117
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
900 |
self selectionHolder value:''. |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
901 |
self enableDefects value:false. |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
902 |
self enableDebugButton value:false. |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
903 |
^ self |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
904 |
]. |
0 | 905 |
allDefects := Dictionary new. |
906 |
aCollection do: [:each | allDefects at: each printString put: each]. |
|
117
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
907 |
failedTests := allDefects keys asOrderedCollection sort. |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
908 |
self defectMenu value: failedTests. |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
909 |
"/ self selectionHolder value: failedTests first withoutNotifying:self. |
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
910 |
self enableDefects value:true. |
0 | 911 |
|
912 |
"Modified: / 4.4.2000 / 20:11:06 / Sames" |
|
913 |
! |
|
914 |
||
915 |
displayDetails: aString |
|
94 | 916 |
self details value: aString. |
917 |
self repairDamage. |
|
0 | 918 |
|
919 |
"Modified: / 21.6.2000 / 11:10:14 / Sames" |
|
920 |
! |
|
921 |
||
25
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
922 |
displayErrorColorInProgress |
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
923 |
(self builder componentAt:#ProgressIndicator1) |
42 | 924 |
foregroundColor: (self class colorForFailedTests). |
25
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
925 |
|
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
926 |
"/ (self builder componentAt:#ProgressIndicator1) |
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
927 |
"/ backgroundColor: (Color red:67 green:0 blue:0) |
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
928 |
! |
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
929 |
|
0 | 930 |
displayFail |
30 | 931 |
self displayRed. |
932 |
self displayMode: 'Fail'. |
|
933 |
self displayDetails: result printString. |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
934 |
! |
0 | 935 |
|
17 | 936 |
displayGray |
30 | 937 |
self displayColor: (View defaultViewBackgroundColor) |
17 | 938 |
! |
939 |
||
0 | 940 |
displayGreen |
30 | 941 |
self displayColor: ColorValue green |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
942 |
! |
0 | 943 |
|
944 |
displayMode: aString |
|
51 | 945 |
self mode value: aString. |
946 |
self repairDamage. |
|
0 | 947 |
|
948 |
"Modified: / 21.6.2000 / 11:14:19 / Sames" |
|
949 |
! |
|
950 |
||
25
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
951 |
displayNormalColorInProgress |
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
952 |
(self builder componentAt:#ProgressIndicator1) |
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
953 |
foregroundColor: (Color red:33 green:33 blue:0); |
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
954 |
backgroundColor: (Color red:67 green:67 blue:0) |
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
955 |
! |
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
956 |
|
0 | 957 |
displayPass |
55 | 958 |
self displayGreen. |
64 | 959 |
(lastTestCase notNil |
960 |
and:[lastTestCase name notNil]) ifTrue:[ |
|
961 |
self displayMode: 'Pass ' , lastTestCase name. |
|
962 |
] ifFalse:[ |
|
963 |
self displayMode: 'Pass'. |
|
964 |
]. |
|
0 | 965 |
self displayDetails: result runCount printString , ' run' , self timeSinceLastPassAsString. |
966 |
lastPass := Time now |
|
967 |
||
968 |
"Modified: / 21.6.2000 / 12:14:52 / Sames" |
|
969 |
! |
|
970 |
||
971 |
displayRed |
|
30 | 972 |
self displayColor: ColorValue red. |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
973 |
! |
0 | 974 |
|
975 |
displayRefresh |
|
976 |
self displayMode: 'N/A'. |
|
977 |
self displayDetails:'...'. |
|
978 |
self updateDefects. |
|
79 | 979 |
self enableRunButton value: (self script value notNil). |
117
13bdbc0cefce
Better handling of failed testcases.
Stefan Vogel <sv@exept.de>
parents:
115
diff
changeset
|
980 |
self enableDefects value: false. |
0 | 981 |
self enableDebugButton value: false. |
982 |
self displayDefault |
|
983 |
||
984 |
"Created: / 21.6.2000 / 12:14:11 / Sames" |
|
985 |
"Modified: / 21.6.2000 / 12:28:24 / Sames" |
|
986 |
! |
|
987 |
||
988 |
displayRunning |
|
39 | 989 |
self displayRunning:(self selectedScript ? 'all') string. |
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
990 |
! |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
991 |
|
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
992 |
displayRunning:scriptName |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
993 |
self displayYellow. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
994 |
self displayMode:('running ' , scriptName allBold). |
61
b9204f5672ae
show each cases selector as it is executed
Claus Gittinger <cg@exept.de>
parents:
60
diff
changeset
|
995 |
"/ self displayDetails: '...'. |
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
996 |
self repairDamage. |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
997 |
! |
0 | 998 |
|
999 |
displayYellow |
|
30 | 1000 |
self displayColor: ColorValue yellow |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
1001 |
! |
0 | 1002 |
|
25
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1003 |
hidePercentageIndicator |
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1004 |
self percentageIndicatorVisible value:false. |
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1005 |
! |
24
0f897c4468c3
automatic update, when new testCase classes arrive,
Claus Gittinger <cg@exept.de>
parents:
23
diff
changeset
|
1006 |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1007 |
repairDamage |
82 | 1008 |
|wg| |
1009 |
||
1010 |
(wg := self windowGroup) notNil ifTrue:[wg repairDamage]. |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1011 |
! |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1012 |
|
25
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1013 |
showPercentageIndicator |
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1014 |
self percentageIndicatorVisible value:true. |
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1015 |
! |
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1016 |
|
30 | 1017 |
update:something with:aParameter from:changedObject |
24
0f897c4468c3
automatic update, when new testCase classes arrive,
Claus Gittinger <cg@exept.de>
parents:
23
diff
changeset
|
1018 |
changedObject == Smalltalk ifTrue:[ |
30 | 1019 |
(changedObject isBehavior and:[changedObject isSubclassOf:TestCase]) ifTrue:[ |
28 | 1020 |
self updateSuitesList |
1021 |
]. |
|
1022 |
^ self |
|
25
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1023 |
]. |
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1024 |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1025 |
(changedObject isKindOf: TestSuite) ifTrue: [ |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1026 |
self displayRunning:changedObject name. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1027 |
^ self |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1028 |
]. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1029 |
|
30 | 1030 |
(changedObject isKindOf: TestCase) ifTrue: [ |
28 | 1031 |
(result errorCount + result failureCount) > 0 ifTrue:[ |
1032 |
self displayErrorColorInProgress. |
|
1033 |
]. |
|
1034 |
self percentageDone value:(result runCount / numberOfTestsToRun * 100) rounded. |
|
30 | 1035 |
self displayDetails: changedObject printString. |
28 | 1036 |
^ self |
25
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1037 |
]. |
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1038 |
|
30 | 1039 |
super update:something with:aParameter from:changedObject |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
1040 |
! |
0 | 1041 |
|
1042 |
updateDefects |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1043 |
|script| |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1044 |
|
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1045 |
script := self selectedScript. |
39 | 1046 |
script notNil ifTrue:[script := script string]. |
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1047 |
|
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1048 |
self displayDefects: result defects. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1049 |
|
39 | 1050 |
script notNil ifTrue:[ |
1051 |
result hasPassed ifTrue:[ |
|
80 | 1052 |
self testPassed:script |
39 | 1053 |
] ifFalse:[ |
87
24e88e7f5d88
remember individual failed cases.
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
1054 |
self testFailed:script withResult:result |
39 | 1055 |
]. |
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1056 |
]. |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
1057 |
! |
0 | 1058 |
|
1059 |
updateWindow |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1060 |
result hasPassed |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1061 |
ifTrue: [self displayPass] |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1062 |
ifFalse: [self displayFail]. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1063 |
self updateDefects. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1064 |
self updateSuitesList. "/ for colors |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
1065 |
! ! |
0 | 1066 |
|
11 | 1067 |
!TestRunner class methodsFor:'documentation'! |
1068 |
||
1069 |
version |
|
178 | 1070 |
^ '$Header: /cvs/stx/stx/goodies/sunit/TestRunner.st,v 1.57 2008-03-10 09:26:30 cg Exp $' |
11 | 1071 |
! ! |