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