author | james |
Thu, 07 Feb 2002 18:19:00 +0100 | |
changeset 64 | ef347b158415 |
parent 61 | b9204f5672ae |
child 65 | 019891d527b7 |
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) |
51 | 120 |
#bounds: #(#Rectangle 13 23 506 198) |
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 |
39 | 137 |
#model: #category |
138 |
#menu: #categoryList |
|
139 |
) |
|
140 |
#(#MenuButtonSpec |
|
141 |
#name: #tests |
|
142 |
#layout: #(#LayoutFrame 76 0 24 0 -216 1 48 0) |
|
51 | 143 |
#activeHelpKey: #suiteSelection |
39 | 144 |
#model: #script |
145 |
#menu: #scriptModel |
|
146 |
#useIndex: true |
|
147 |
) |
|
148 |
#(#ActionButtonSpec |
|
149 |
#label: 'Run' |
|
150 |
#name: 'Button1' |
|
151 |
#layout: #(#LayoutFrame -215 1 0 0 -160 1 48 0) |
|
51 | 152 |
#activeHelpKey: #runButton |
39 | 153 |
#model: #runTests |
154 |
#enableChannel: #enableRunButton |
|
155 |
) |
|
156 |
#(#ActionButtonSpec |
|
157 |
#label: 'ReRun Defects' |
|
158 |
#name: 'Button5' |
|
159 |
#layout: #(#LayoutFrame -159 1 0 0 -57 1 48 0) |
|
51 | 160 |
#activeHelpKey: #rerunDefectsButton |
39 | 161 |
#model: #runDefects |
162 |
#enableChannel: #enableRunDefectsButton |
|
163 |
) |
|
164 |
#(#ActionButtonSpec |
|
165 |
#label: 'Run All' |
|
166 |
#name: 'Button2' |
|
167 |
#layout: #(#LayoutFrame -56 1 0 0 0 1 48 0) |
|
51 | 168 |
#activeHelpKey: #runAllButton |
39 | 169 |
#model: #runAllTests |
170 |
) |
|
171 |
#(#ProgressIndicatorSpec |
|
172 |
#name: 'ProgressIndicator1' |
|
173 |
#layout: #(#LayoutFrame 0 0.0 49 0 0 1.0 60 0) |
|
174 |
#visibilityChannel: #percentageIndicatorVisible |
|
175 |
#model: #percentageDone |
|
176 |
#foregroundColor: #(#Color 32.9992 32.9992 0.0) |
|
177 |
#backgroundColor: #(#Color 66.9993 66.9993 0.0) |
|
178 |
#showPercentage: false |
|
179 |
) |
|
180 |
#(#LabelSpec |
|
51 | 181 |
#label: '...' |
182 |
#name: 'details' |
|
183 |
#layout: #(#LayoutFrame 0 0 21 0.5 0 1 -25 1) |
|
184 |
#labelChannel: #details |
|
185 |
) |
|
186 |
#(#LabelSpec |
|
39 | 187 |
#label: 'N/A' |
188 |
#name: 'mode' |
|
51 | 189 |
#layout: #(#LayoutFrame 0 0 49 0 0 1 35 0.5) |
39 | 190 |
#style: #(#FontDescription #Arial #bold #roman 14) |
191 |
#labelChannel: #mode |
|
192 |
) |
|
193 |
#(#MenuButtonSpec |
|
194 |
#name: #defects |
|
195 |
#layout: #(#LayoutFrame 0 0 -24 1 -152 1 0 1) |
|
196 |
#isOpaque: true |
|
197 |
#flags: 40 |
|
51 | 198 |
#activeHelpKey: #defectsList |
39 | 199 |
#model: #selectionHolder |
200 |
#initiallyDisabled: true |
|
201 |
#enableChannel: #enableDefectsList |
|
202 |
#menu: #defectMenu |
|
203 |
) |
|
204 |
#(#ActionButtonSpec |
|
205 |
#label: 'Browse' |
|
206 |
#name: 'Button4' |
|
207 |
#layout: #(#LayoutFrame -151 1 -24 1 -76 1 0 1) |
|
51 | 208 |
#activeHelpKey: #browseButton |
39 | 209 |
#model: #browseSelectedTestCase |
210 |
#initiallyDisabled: true |
|
211 |
#enableChannel: #enableRunButton |
|
212 |
) |
|
213 |
#(#ActionButtonSpec |
|
214 |
#label: 'Debug' |
|
215 |
#name: 'Button6' |
|
216 |
#layout: #(#LayoutFrame -75 1 -24 1 0 1 0 1) |
|
51 | 217 |
#activeHelpKey: #debugButton |
39 | 218 |
#model: #debugSelectedFailure |
219 |
#initiallyDisabled: true |
|
220 |
#enableChannel: #enableDebugButton |
|
221 |
) |
|
222 |
) |
|
0 | 223 |
|
39 | 224 |
) |
0 | 225 |
) |
226 |
! ! |
|
227 |
||
228 |
!TestRunner class methodsFor:'opening'! |
|
229 |
||
230 |
open |
|
231 |
||
30 | 232 |
^super open |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
233 |
! |
5 | 234 |
|
235 |
openOnTestCase:aTestCaseSubclass |
|
236 |
|runner idx| |
|
237 |
||
238 |
runner := self new. |
|
239 |
runner open. |
|
240 |
runner window waitUntilVisible. |
|
15 | 241 |
|
5 | 242 |
idx := runner scriptModel value indexOf:aTestCaseSubclass name. |
60 | 243 |
runner selectScriptNamed:aTestCaseSubclass name. |
5 | 244 |
|
245 |
" |
|
246 |
self openOnTestCase:CompilerTest |
|
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 |
||
269 |
!TestRunner methodsFor:'Accessing'! |
|
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 |
|
30 | 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 |
|
30 | 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 |
336 |
|holder| |
|
337 |
||
338 |
(holder := builder bindingAt:#percentageDone) isNil ifTrue:[ |
|
30 | 339 |
holder := 0 asValue. |
340 |
builder aspectAt:#percentageDone put:holder. |
|
19 | 341 |
]. |
342 |
^ holder. |
|
343 |
! |
|
344 |
||
345 |
percentageIndicatorVisible |
|
346 |
|holder| |
|
347 |
||
348 |
(holder := builder bindingAt:#percentageIndicatorVisible) isNil ifTrue:[ |
|
30 | 349 |
holder := false asValue. |
350 |
builder aspectAt:#percentageIndicatorVisible put:holder. |
|
19 | 351 |
]. |
352 |
^ holder. |
|
353 |
! |
|
354 |
||
0 | 355 |
script |
356 |
"automatically generated by UIPainter ..." |
|
357 |
||
358 |
"*** the code below creates a default model when invoked." |
|
359 |
"*** (which may not be the one you wanted)" |
|
360 |
"*** Please change as required and accept it in the browser." |
|
361 |
||
55 | 362 |
script isNil ifTrue:[ |
363 |
script := ValueHolder new. |
|
364 |
script onChangeSend:#suiteSelectionChanged to:self. |
|
0 | 365 |
]. |
55 | 366 |
^ script. |
0 | 367 |
|
368 |
"Created: / 21.6.2000 / 12:04:36 / Sames" |
|
369 |
! |
|
370 |
||
371 |
script:something |
|
372 |
"automatically generated by UIPainter ..." |
|
373 |
||
374 |
"This method is used when I am embedded as subApplication," |
|
375 |
"and the mainApp wants to connect its aspects to mine." |
|
376 |
||
377 |
"/ |holder| |
|
378 |
||
379 |
"/ (holder := builder bindingAt:#script) notNil ifTrue:[ |
|
380 |
"/ holder removeDependent:self. |
|
381 |
"/ ]. |
|
382 |
builder aspectAt:#script put:something. |
|
383 |
"/ something notNil ifTrue:[ |
|
384 |
"/ something addDependent:self. |
|
385 |
"/ ]. |
|
386 |
^ self. |
|
387 |
||
388 |
"Created: / 21.6.2000 / 12:04:36 / Sames" |
|
389 |
! |
|
390 |
||
391 |
scriptModel |
|
392 |
"This method was generated by UIDefiner. Any edits made here |
|
28 | 393 |
may be lost whenever methods are automatically defined. The |
394 |
initialization provided below may have been preempted by an |
|
395 |
initialize method." |
|
0 | 396 |
|
397 |
^scriptModel isNil |
|
28 | 398 |
ifTrue: [scriptModel := ValueHolder new. self updateSuitesList. scriptModel] |
399 |
ifFalse: [scriptModel] |
|
0 | 400 |
|
401 |
"Modified: / 2.4.2000 / 14:37:51 / Sames" |
|
402 |
! |
|
403 |
||
404 |
selection |
|
405 |
||
30 | 406 |
^defect |
0 | 407 |
|
408 |
"Created: / 4.4.2000 / 18:50:55 / Sames" |
|
409 |
! |
|
410 |
||
411 |
selectionHolder |
|
412 |
"automatically generated by UIPainter ..." |
|
413 |
||
414 |
"*** the code below creates a default model when invoked." |
|
415 |
"*** (which may not be the one you wanted)" |
|
416 |
"*** Please change as required and accept it in the browser." |
|
417 |
||
418 |
|holder| |
|
419 |
||
420 |
(holder := builder bindingAt:#selectionHolder) isNil ifTrue:[ |
|
30 | 421 |
holder := AspectAdaptor new subject:self; forAspect:#selection. |
422 |
builder aspectAt:#selectionHolder put:holder. |
|
0 | 423 |
"/ holder addDependent:self. |
424 |
]. |
|
425 |
^ holder. |
|
426 |
||
427 |
"Created: / 4.4.2000 / 18:46:08 / Sames" |
|
428 |
"Modified: / 4.4.2000 / 18:47:31 / Sames" |
|
429 |
! |
|
430 |
||
431 |
tests |
|
432 |
||
30 | 433 |
^self builder componentAt: #tests |
0 | 434 |
|
435 |
"Created: / 4.4.2000 / 19:57:37 / Sames" |
|
436 |
! ! |
|
437 |
||
438 |
!TestRunner methodsFor:'Actions'! |
|
439 |
||
10 | 440 |
browseSelectedTestCase |
51 | 441 |
|testCaseName testCase browser| |
10 | 442 |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
443 |
testCaseName := self selectedScript. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
444 |
testCaseName notNil ifTrue:[ |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
445 |
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
|
446 |
testCase notNil ifTrue:[ |
51 | 447 |
browser := UserPreferences current systemBrowserClass openInClass:testCase. |
448 |
MessageNotUnderstood |
|
449 |
handle:[:ex | ] |
|
450 |
do:[ browser selectProtocolsMatching:'*'] |
|
451 |
||
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
452 |
] |
10 | 453 |
] |
454 |
! |
|
455 |
||
39 | 456 |
categorySelectionChanged |
60 | 457 |
|selectedScriptIndex selectedScript oldSuitesList newSuitesList |
458 |
newScriptSelectionIndex| |
|
55 | 459 |
|
460 |
selectedScriptIndex := self script value. |
|
461 |
oldSuitesList := self scriptModel value. |
|
462 |
||
463 |
selectedScriptIndex notNil ifTrue:[ |
|
464 |
selectedScript := (oldSuitesList at:selectedScriptIndex) string |
|
465 |
]. |
|
466 |
||
467 |
self updateSuitesList. |
|
468 |
||
469 |
newSuitesList := self scriptModel value. |
|
60 | 470 |
newScriptSelectionIndex := newSuitesList indexOf:selectedScript. |
471 |
||
472 |
self script value:(newScriptSelectionIndex == 0 |
|
473 |
ifTrue:[nil] |
|
474 |
ifFalse:[newScriptSelectionIndex]). |
|
39 | 475 |
! |
476 |
||
0 | 477 |
debugSelectedFailure |
30 | 478 |
self debugTest: self selection |
0 | 479 |
|
480 |
"Created: / 21.6.2000 / 10:58:58 / Sames" |
|
481 |
"Modified: / 21.6.2000 / 12:21:05 / Sames" |
|
482 |
! |
|
483 |
||
484 |
debugTest: aTestCaseName |
|
485 |
| testCase | |
|
29
ada4e34e33ec
allow reselecting in defect-popUpList
Claus Gittinger <cg@exept.de>
parents:
28
diff
changeset
|
486 |
|
0 | 487 |
defect := aTestCaseName. |
488 |
testCase := allDefects at: aTestCaseName ifAbsent: [nil]. |
|
489 |
testCase isNil ifTrue: [^self enableDebugButton value: false]. |
|
490 |
self enableDebugButton value: true. |
|
491 |
self displayMode: 'Debugging'. |
|
492 |
||
29
ada4e34e33ec
allow reselecting in defect-popUpList
Claus Gittinger <cg@exept.de>
parents:
28
diff
changeset
|
493 |
defect := nil. |
ada4e34e33ec
allow reselecting in defect-popUpList
Claus Gittinger <cg@exept.de>
parents:
28
diff
changeset
|
494 |
self withWaitCursorDo:[ |
ada4e34e33ec
allow reselecting in defect-popUpList
Claus Gittinger <cg@exept.de>
parents:
28
diff
changeset
|
495 |
(result isFailure: testCase) |
ada4e34e33ec
allow reselecting in defect-popUpList
Claus Gittinger <cg@exept.de>
parents:
28
diff
changeset
|
496 |
ifTrue: [testCase debugAsFailure] |
ada4e34e33ec
allow reselecting in defect-popUpList
Claus Gittinger <cg@exept.de>
parents:
28
diff
changeset
|
497 |
ifFalse: [testCase debug]. |
ada4e34e33ec
allow reselecting in defect-popUpList
Claus Gittinger <cg@exept.de>
parents:
28
diff
changeset
|
498 |
]. |
0 | 499 |
"Modified: / 21.6.2000 / 12:12:09 / Sames" |
500 |
! |
|
501 |
||
502 |
enableDebugButton |
|
503 |
"automatically generated by UIPainter ..." |
|
504 |
"*** the code below creates a default model when invoked." |
|
505 |
"*** (which may not be the one you wanted)" |
|
506 |
"*** Please change as required and accept it in the browser." |
|
507 |
||
508 |
| holder | |
|
509 |
(holder := builder bindingAt: #enableDebugButton) isNil |
|
30 | 510 |
ifTrue: |
511 |
[holder := true asValue. |
|
512 |
builder aspectAt: #enableDebugButton put: holder |
|
513 |
" holder addDependent:self."]. |
|
0 | 514 |
^holder |
515 |
||
516 |
"Created: / 21.6.2000 / 10:47:34 / Sames" |
|
517 |
"Modified: / 21.6.2000 / 10:51:07 / Sames" |
|
518 |
! |
|
519 |
||
520 |
enableDefectsList |
|
521 |
"automatically generated by UIPainter ..." |
|
522 |
||
523 |
"*** the code below creates a default model when invoked." |
|
524 |
"*** (which may not be the one you wanted)" |
|
525 |
"*** Please change as required and accept it in the browser." |
|
526 |
||
527 |
|holder| |
|
528 |
||
529 |
(holder := builder bindingAt:#enableDefectsList) isNil ifTrue:[ |
|
30 | 530 |
holder := true asValue. |
531 |
builder aspectAt:#enableDefectsList put:holder. |
|
0 | 532 |
"/ holder addDependent:self. |
533 |
]. |
|
534 |
^ holder. |
|
535 |
||
536 |
"Created: / 21.6.2000 / 10:47:34 / Sames" |
|
537 |
! |
|
538 |
||
539 |
enableRunButton |
|
540 |
"automatically generated by UIPainter ..." |
|
541 |
||
542 |
"*** the code below creates a default model when invoked." |
|
543 |
"*** (which may not be the one you wanted)" |
|
544 |
"*** Please change as required and accept it in the browser." |
|
545 |
||
546 |
|holder| |
|
547 |
||
548 |
(holder := builder bindingAt:#enableRunButton) isNil ifTrue:[ |
|
30 | 549 |
holder := true asValue. |
550 |
builder aspectAt:#enableRunButton put:holder. |
|
0 | 551 |
"/ holder addDependent:self. |
552 |
]. |
|
553 |
^ holder. |
|
554 |
||
555 |
"Created: / 21.6.2000 / 10:47:34 / Sames" |
|
556 |
! |
|
557 |
||
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
558 |
enableRunDefectsButton |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
559 |
"automatically generated by UIPainter ..." |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
560 |
|
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
561 |
"*** 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
|
562 |
"*** (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
|
563 |
"*** 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
|
564 |
|
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
565 |
|holder| |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
566 |
|
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
567 |
(holder := builder bindingAt:#enableRunDefectsButton) isNil ifTrue:[ |
30 | 568 |
holder := true asValue. |
569 |
builder aspectAt:#enableRunDefectsButton put:holder. |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
570 |
"/ holder addDependent:self. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
571 |
]. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
572 |
^ holder. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
573 |
! |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
574 |
|
0 | 575 |
refreshSuites |
39 | 576 |
self updateCategoryList. |
577 |
self updateSuitesList. |
|
578 |
||
579 |
self script value:nil. |
|
580 |
self tests selection: 0. |
|
581 |
self defects selection: 0. |
|
582 |
result := TestResult new. |
|
64 | 583 |
lastTestCase := nil. |
39 | 584 |
self displayRefresh |
0 | 585 |
|
586 |
"Created: / 21.6.2000 / 10:58:34 / Sames" |
|
587 |
"Modified: / 21.6.2000 / 12:19:54 / Sames" |
|
588 |
! |
|
589 |
||
590 |
runAllTests |
|
30 | 591 |
self runSuite: self allTestSuite |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
592 |
! |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
593 |
|
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
594 |
runDefectTests |
30 | 595 |
| testSuite | |
596 |
(testSuite := self defectTestSuite) notNil ifTrue: |
|
597 |
[self runSuite: testSuite] |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
598 |
! |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
599 |
|
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
600 |
runDefects |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
601 |
allDefects size > 0 ifTrue:[ |
30 | 602 |
^ self runDefectTests |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
603 |
]. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
604 |
self runTests |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
605 |
! |
0 | 606 |
|
607 |
runSuite: aTestSuite |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
608 |
|numTests| |
19 | 609 |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
610 |
"/ 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
|
611 |
numTests := 0. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
612 |
aTestSuite tests do:[:eachTestOrSubSuite | |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
613 |
(eachTestOrSubSuite isKindOf:TestSuite) ifTrue:[ |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
614 |
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
|
615 |
] ifFalse:[ |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
616 |
numTests := numTests + 1. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
617 |
] |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
618 |
]. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
619 |
numberOfTestsToRun := numTests. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
620 |
self percentageDone value:0. |
19 | 621 |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
622 |
Cursor |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
623 |
wait |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
624 |
showWhile:[ |
39 | 625 |
|errorCountBefore failureCountBefore| |
626 |
||
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
627 |
self displayRunning. |
61
b9204f5672ae
show each cases selector as it is executed
Claus Gittinger <cg@exept.de>
parents:
60
diff
changeset
|
628 |
self displayDetails: '...'. |
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
629 |
aTestSuite addDependentToHierachy: self. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
630 |
result := TestResult new. |
64 | 631 |
lastTestCase := aTestSuite. |
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
632 |
self showPercentageIndicator. |
25
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
633 |
|
39 | 634 |
errorCountBefore := result errorCount. |
635 |
failureCountBefore := result failureCount. |
|
636 |
||
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
637 |
[ |
39 | 638 |
aTestSuite |
639 |
run:result |
|
61
b9204f5672ae
show each cases selector as it is executed
Claus Gittinger <cg@exept.de>
parents:
60
diff
changeset
|
640 |
beforeEachDo:[:eachCaseOrSuite :eachResult | |
39 | 641 |
|caseName passed errorCountAfter failureCountAfter| |
642 |
||
61
b9204f5672ae
show each cases selector as it is executed
Claus Gittinger <cg@exept.de>
parents:
60
diff
changeset
|
643 |
(eachCaseOrSuite isKindOf:TestCase) ifTrue:[ |
b9204f5672ae
show each cases selector as it is executed
Claus Gittinger <cg@exept.de>
parents:
60
diff
changeset
|
644 |
caseName := eachCaseOrSuite selector. |
b9204f5672ae
show each cases selector as it is executed
Claus Gittinger <cg@exept.de>
parents:
60
diff
changeset
|
645 |
] ifFalse:[ |
b9204f5672ae
show each cases selector as it is executed
Claus Gittinger <cg@exept.de>
parents:
60
diff
changeset
|
646 |
caseName := eachCaseOrSuite name. |
b9204f5672ae
show each cases selector as it is executed
Claus Gittinger <cg@exept.de>
parents:
60
diff
changeset
|
647 |
]. |
39 | 648 |
caseName size == 0 ifTrue:[self halt]. |
649 |
||
61
b9204f5672ae
show each cases selector as it is executed
Claus Gittinger <cg@exept.de>
parents:
60
diff
changeset
|
650 |
self displayDetails:(caseName , '...'). |
b9204f5672ae
show each cases selector as it is executed
Claus Gittinger <cg@exept.de>
parents:
60
diff
changeset
|
651 |
|
b9204f5672ae
show each cases selector as it is executed
Claus Gittinger <cg@exept.de>
parents:
60
diff
changeset
|
652 |
testsWhichFailed remove:caseName ifAbsent:nil. |
b9204f5672ae
show each cases selector as it is executed
Claus Gittinger <cg@exept.de>
parents:
60
diff
changeset
|
653 |
testsWhichPassed remove:caseName ifAbsent:nil. |
b9204f5672ae
show each cases selector as it is executed
Claus Gittinger <cg@exept.de>
parents:
60
diff
changeset
|
654 |
] |
b9204f5672ae
show each cases selector as it is executed
Claus Gittinger <cg@exept.de>
parents:
60
diff
changeset
|
655 |
afterEachDo:[:eachCaseOrSuite :eachResult | |
b9204f5672ae
show each cases selector as it is executed
Claus Gittinger <cg@exept.de>
parents:
60
diff
changeset
|
656 |
|caseName passed errorCountAfter failureCountAfter| |
b9204f5672ae
show each cases selector as it is executed
Claus Gittinger <cg@exept.de>
parents:
60
diff
changeset
|
657 |
|
b9204f5672ae
show each cases selector as it is executed
Claus Gittinger <cg@exept.de>
parents:
60
diff
changeset
|
658 |
caseName := eachCaseOrSuite name. |
b9204f5672ae
show each cases selector as it is executed
Claus Gittinger <cg@exept.de>
parents:
60
diff
changeset
|
659 |
caseName size == 0 ifTrue:[self halt]. |
b9204f5672ae
show each cases selector as it is executed
Claus Gittinger <cg@exept.de>
parents:
60
diff
changeset
|
660 |
self displayDetails:('...'). |
b9204f5672ae
show each cases selector as it is executed
Claus Gittinger <cg@exept.de>
parents:
60
diff
changeset
|
661 |
|
39 | 662 |
errorCountAfter := result errorCount. |
663 |
failureCountAfter := result failureCount. |
|
664 |
passed := (errorCountAfter == errorCountBefore) |
|
665 |
& (failureCountAfter == failureCountBefore). |
|
666 |
||
667 |
passed == true ifTrue:[ |
|
668 |
testsWhichPassed add:caseName. |
|
669 |
testsWhichFailed remove:caseName ifAbsent:nil. |
|
670 |
] ifFalse:[ |
|
671 |
testsWhichFailed add:caseName. |
|
672 |
testsWhichPassed remove:caseName ifAbsent:nil. |
|
673 |
]. |
|
674 |
errorCountBefore := errorCountAfter. |
|
675 |
failureCountBefore := failureCountAfter |
|
676 |
] |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
677 |
] ensure: [ |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
678 |
aTestSuite removeDependentFromHierachy: self. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
679 |
self hidePercentageIndicator. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
680 |
self displayNormalColorInProgress. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
681 |
]. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
682 |
self updateWindow |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
683 |
] |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
684 |
! |
0 | 685 |
|
686 |
runTests |
|
30 | 687 |
| testSuite | |
688 |
(testSuite := self freshTestSuite) notNil ifTrue: |
|
689 |
[self runSuite: testSuite] |
|
0 | 690 |
|
691 |
"Modified: / 2.4.2000 / 14:16:10 / Sames" |
|
692 |
! |
|
693 |
||
11 | 694 |
scriptSelectionChanged |
15 | 695 |
self enableRunButton value:(self script value notNil). |
11 | 696 |
! |
697 |
||
0 | 698 |
selection: aValue |
699 |
||
30 | 700 |
self debugTest: aValue |
0 | 701 |
|
702 |
"Created: / 4.4.2000 / 18:54:09 / Sames" |
|
703 |
"Modified: / 4.4.2000 / 19:01:33 / Sames" |
|
704 |
! |
|
705 |
||
29
ada4e34e33ec
allow reselecting in defect-popUpList
Claus Gittinger <cg@exept.de>
parents:
28
diff
changeset
|
706 |
setSelection: aValue |
ada4e34e33ec
allow reselecting in defect-popUpList
Claus Gittinger <cg@exept.de>
parents:
28
diff
changeset
|
707 |
|
ada4e34e33ec
allow reselecting in defect-popUpList
Claus Gittinger <cg@exept.de>
parents:
28
diff
changeset
|
708 |
defect := aValue |
ada4e34e33ec
allow reselecting in defect-popUpList
Claus Gittinger <cg@exept.de>
parents:
28
diff
changeset
|
709 |
! |
ada4e34e33ec
allow reselecting in defect-popUpList
Claus Gittinger <cg@exept.de>
parents:
28
diff
changeset
|
710 |
|
0 | 711 |
suiteSelectionChanged |
8 | 712 |
|ok className description cls| |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
713 |
|
55 | 714 |
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
|
715 |
self enableRunDefectsButton value:(ok and:[allDefects size > 0]). |
0 | 716 |
|
8 | 717 |
self script value notNil ifTrue:[ |
42 | 718 |
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
|
719 |
(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
|
720 |
cls := Smalltalk at:className. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
721 |
(cls class implements:#description) ifTrue:[ |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
722 |
description := cls description. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
723 |
] |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
724 |
]. |
8 | 725 |
]. |
17 | 726 |
self displayDetails:nil. |
727 |
self displayMode: (description ? ''). |
|
728 |
self displayGray. |
|
8 | 729 |
|
0 | 730 |
"Created: / 21.6.2000 / 11:31:25 / Sames" |
731 |
"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
|
732 |
! |
0f897c4468c3
automatic update, when new testCase classes arrive,
Claus Gittinger <cg@exept.de>
parents:
23
diff
changeset
|
733 |
|
39 | 734 |
suitesInCategory |
735 |
|suites cat allCategories| |
|
736 |
||
737 |
cat := self category value. |
|
738 |
allCategories := (cat = '* all *'). |
|
739 |
||
740 |
suites := TestCase allSubclasses |
|
741 |
select:[:each | allCategories or:[cat = each category]] |
|
742 |
thenCollect: [:each | each name]. |
|
743 |
suites sort. |
|
744 |
^ suites |
|
745 |
! |
|
746 |
||
747 |
updateCategoryList |
|
748 |
|categories| |
|
749 |
||
750 |
categories := (TestCase allSubclasses collect: [:each | each category]) asSet asOrderedCollection. |
|
751 |
categories sort. |
|
752 |
categories addFirst:'* all *'. |
|
753 |
self categoryList value:categories. |
|
754 |
! |
|
755 |
||
24
0f897c4468c3
automatic update, when new testCase classes arrive,
Claus Gittinger <cg@exept.de>
parents:
23
diff
changeset
|
756 |
updateSuitesList |
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
757 |
|suites| |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
758 |
|
39 | 759 |
suites := self suitesInCategory. |
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
760 |
suites := suites |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
761 |
collect:[:eachSuiteName | |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
762 |
(testsWhichFailed includes:eachSuiteName) ifTrue:[ |
42 | 763 |
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
|
764 |
] ifFalse:[ |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
765 |
(testsWhichPassed includes:eachSuiteName) ifTrue:[ |
42 | 766 |
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
|
767 |
] ifFalse:[ |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
768 |
eachSuiteName |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
769 |
] |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
770 |
]. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
771 |
]. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
772 |
self scriptModel value: suites. |
0 | 773 |
! ! |
774 |
||
775 |
!TestRunner methodsFor:'Private'! |
|
776 |
||
777 |
allTestSuite |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
778 |
"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
|
779 |
|
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
780 |
| tokens stream suite| |
39 | 781 |
|
782 |
tokens := (self suitesInCategory |
|
783 |
collect: [:eachName | eachName ", '*' " ]) |
|
784 |
copyWithout: 'SUnitTest* '. |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
785 |
stream := WriteStream on: String new. |
39 | 786 |
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
|
787 |
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
|
788 |
suite name:'all'. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
789 |
^ suite |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
790 |
! |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
791 |
|
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
792 |
defectTestSuite |
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
793 |
|suite| |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
794 |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
795 |
suite := TestSuite new. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
796 |
suite name:'defects'. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
797 |
allDefects keysAndValuesDo:[:nm :test | |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
798 |
suite addTest:test. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
799 |
]. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
800 |
^suite |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
801 |
! |
0 | 802 |
|
803 |
formatTime: aTime |
|
30 | 804 |
aTime hours > 0 ifTrue: [^aTime hours printString , 'h']. |
805 |
aTime minutes > 0 ifTrue: [^aTime minutes printString , 'min']. |
|
806 |
^aTime seconds printString , ' sec' |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
807 |
! |
0 | 808 |
|
809 |
freshTestSuite |
|
59 | 810 |
|tests| |
0 | 811 |
|
59 | 812 |
tests := self tests contents. |
813 |
tests isNil ifTrue:[ ^ nil]. |
|
814 |
^TestSuitesScripter run: tests |
|
0 | 815 |
|
816 |
"Modified: / 4.4.2000 / 20:13:41 / Sames" |
|
817 |
! |
|
818 |
||
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
819 |
initialize |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
820 |
super initialize. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
821 |
|
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
822 |
testsWhichPassed := Set new. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
823 |
testsWhichFailed := Set new. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
824 |
! |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
825 |
|
0 | 826 |
postOpenWith: aBuilder |
827 |
"automatically generated by UIPainter ..." |
|
828 |
||
829 |
super postOpenWith: aBuilder. |
|
830 |
self tests defaultLabel: ''. |
|
11 | 831 |
"/ self tests selection: 'ExampleSetTest'. self script value:1. |
15 | 832 |
|
833 |
self enableRunButton value: (self script value notNil). |
|
10 | 834 |
self enableRunDefectsButton value: false. |
0 | 835 |
self enableDebugButton value: false. |
836 |
self enableDefectsList value: false. |
|
24
0f897c4468c3
automatic update, when new testCase classes arrive,
Claus Gittinger <cg@exept.de>
parents:
23
diff
changeset
|
837 |
self script onChangeSend: #suiteSelectionChanged to:self. |
0f897c4468c3
automatic update, when new testCase classes arrive,
Claus Gittinger <cg@exept.de>
parents:
23
diff
changeset
|
838 |
|
0f897c4468c3
automatic update, when new testCase classes arrive,
Claus Gittinger <cg@exept.de>
parents:
23
diff
changeset
|
839 |
Smalltalk addDependent:self. |
0 | 840 |
|
841 |
"Created: / 2.4.2000 / 14:44:32 / Sames" |
|
842 |
"Modified: / 21.6.2000 / 12:06:30 / Sames" |
|
843 |
! |
|
844 |
||
24
0f897c4468c3
automatic update, when new testCase classes arrive,
Claus Gittinger <cg@exept.de>
parents:
23
diff
changeset
|
845 |
release |
0f897c4468c3
automatic update, when new testCase classes arrive,
Claus Gittinger <cg@exept.de>
parents:
23
diff
changeset
|
846 |
Smalltalk removeDependent:self. |
0f897c4468c3
automatic update, when new testCase classes arrive,
Claus Gittinger <cg@exept.de>
parents:
23
diff
changeset
|
847 |
super release. |
0f897c4468c3
automatic update, when new testCase classes arrive,
Claus Gittinger <cg@exept.de>
parents:
23
diff
changeset
|
848 |
! |
0f897c4468c3
automatic update, when new testCase classes arrive,
Claus Gittinger <cg@exept.de>
parents:
23
diff
changeset
|
849 |
|
60 | 850 |
selectScriptNamed:aScriptName |
851 |
|idx scriptClass| |
|
852 |
||
853 |
idx := self scriptModel value indexOf:aScriptName. |
|
854 |
self script value:idx. |
|
855 |
||
856 |
self updateCategoryList. |
|
857 |
||
858 |
scriptClass := Smalltalk at:aScriptName asSymbol. |
|
859 |
scriptClass notNil ifTrue:[ |
|
860 |
self category value:scriptClass category. |
|
861 |
] |
|
862 |
! |
|
863 |
||
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
864 |
selectedScript |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
865 |
|scriptIndex| |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
866 |
|
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
867 |
scriptIndex := self script value. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
868 |
scriptIndex isNil ifTrue:[ |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
869 |
^ '' |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
870 |
]. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
871 |
^ 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
|
872 |
! |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
873 |
|
0 | 874 |
timeSinceLastPassAsString |
30 | 875 |
lastPass isNil ifTrue: [^'']. |
876 |
^', ' , (self formatTime: (Time now subtractTime: lastPass getSeconds)) , ' since last Pass' |
|
0 | 877 |
|
878 |
"Modified: / 3.4.2000 / 19:17:11 / Sames" |
|
879 |
! ! |
|
880 |
||
881 |
!TestRunner methodsFor:'Updating'! |
|
882 |
||
883 |
displayColor: aColorValue |
|
884 |
||
30 | 885 |
(builder componentAt: #mode) widget insideColor: aColorValue. |
886 |
(builder componentAt: #details) widget insideColor: aColorValue. |
|
0 | 887 |
|
888 |
"Modified: / 2.4.2000 / 14:21:42 / Sames" |
|
889 |
! |
|
890 |
||
891 |
displayDefault |
|
30 | 892 |
self displayColor: self tests backgroundColor |
0 | 893 |
|
894 |
"Created: / 21.6.2000 / 12:28:06 / Sames" |
|
895 |
"Modified: / 21.6.2000 / 12:35:09 / Sames" |
|
896 |
! |
|
897 |
||
898 |
displayDefects: aCollection |
|
899 |
| menuButton | |
|
900 |
menuButton := self builder componentAt: #defects. |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
901 |
aCollection isEmpty ifTrue: [ |
30 | 902 |
menuButton disable. |
903 |
self enableRunDefectsButton value:false. |
|
904 |
^ self |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
905 |
]. |
0 | 906 |
allDefects := Dictionary new. |
907 |
aCollection do: [:each | allDefects at: each printString put: each]. |
|
21 | 908 |
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
|
909 |
menuButton enable. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
910 |
self enableRunDefectsButton value:(allDefects size > 0). |
0 | 911 |
|
912 |
"Modified: / 4.4.2000 / 20:11:06 / Sames" |
|
913 |
! |
|
914 |
||
915 |
displayDetails: aString |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
916 |
self details value: aString. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
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. |
|
979 |
self enableRunButton value: false. |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
980 |
self enableRunDefectsButton 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 |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1008 |
self windowGroup repairDamage. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1009 |
! |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1010 |
|
25
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1011 |
showPercentageIndicator |
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1012 |
self percentageIndicatorVisible value:true. |
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1013 |
! |
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1014 |
|
30 | 1015 |
update:something with:aParameter from:changedObject |
24
0f897c4468c3
automatic update, when new testCase classes arrive,
Claus Gittinger <cg@exept.de>
parents:
23
diff
changeset
|
1016 |
changedObject == Smalltalk ifTrue:[ |
30 | 1017 |
(changedObject isBehavior and:[changedObject isSubclassOf:TestCase]) ifTrue:[ |
28 | 1018 |
self updateSuitesList |
1019 |
]. |
|
1020 |
^ self |
|
25
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1021 |
]. |
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1022 |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1023 |
(changedObject isKindOf: TestSuite) ifTrue: [ |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1024 |
self displayRunning:changedObject name. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1025 |
^ self |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1026 |
]. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1027 |
|
30 | 1028 |
(changedObject isKindOf: TestCase) ifTrue: [ |
28 | 1029 |
(result errorCount + result failureCount) > 0 ifTrue:[ |
1030 |
self displayErrorColorInProgress. |
|
1031 |
]. |
|
1032 |
self percentageDone value:(result runCount / numberOfTestsToRun * 100) rounded. |
|
30 | 1033 |
self displayDetails: changedObject printString. |
28 | 1034 |
^ self |
25
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1035 |
]. |
ab09e4669864
change progressindicators color to red, when an error occurs.
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1036 |
|
30 | 1037 |
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
|
1038 |
! |
0 | 1039 |
|
1040 |
updateDefects |
|
38
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1041 |
|script| |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1042 |
|
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1043 |
script := self selectedScript. |
39 | 1044 |
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
|
1045 |
|
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1046 |
self displayDefects: result defects. |
5fb751a669eb
better update (name) and mark failed/passed suites in list
Claus Gittinger <cg@exept.de>
parents:
30
diff
changeset
|
1047 |
|
39 | 1048 |
script notNil ifTrue:[ |
1049 |
result hasPassed ifTrue:[ |
|
1050 |
testsWhichPassed add:script. |
|
1051 |
testsWhichFailed remove:script ifAbsent:nil. |
|
1052 |
] ifFalse:[ |
|
1053 |
testsWhichFailed add:script. |
|
1054 |
testsWhichPassed remove:script ifAbsent:nil. |
|
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 |
|
64 | 1070 |
^ '$Header: /cvs/stx/stx/goodies/sunit/TestRunner.st,v 1.30 2002-02-07 17:19:00 james Exp $' |
11 | 1071 |
! ! |