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