author | vrany |
Fri, 05 Aug 2011 20:45:33 +0200 | |
changeset 10519 | ce67bd704d80 |
parent 10518 | 97c444ba3c46 |
child 10560 | f913f6e25dea |
permissions | -rw-r--r-- |
9953 | 1 |
" |
10090 | 2 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague |
3 |
Copyright (c) 2009-2010 eXept Software AG |
|
9953 | 4 |
|
10090 | 5 |
Permission is hereby granted, free of charge, to any person |
6 |
obtaining a copy of this software and associated documentation |
|
7 |
files (the 'Software'), to deal in the Software without |
|
8 |
restriction, including without limitation the rights to use, |
|
9 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
10 |
copies of the Software, and to permit persons to whom the |
|
11 |
Software is furnished to do so, subject to the following |
|
12 |
conditions: |
|
13 |
||
14 |
The above copyright notice and this permission notice shall be |
|
15 |
included in all copies or substantial portions of the Software. |
|
16 |
||
17 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
18 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
19 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
20 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
21 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
22 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
23 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
24 |
OTHER DEALINGS IN THE SOFTWARE. |
|
9953 | 25 |
" |
26 |
"{ Package: 'stx:libtool' }" |
|
27 |
||
28 |
"{ NameSpace: Tools }" |
|
29 |
||
30 |
AbstractTestRunner subclass:#TestRunner2 |
|
31 |
instanceVariableNames:'classCategoryOrPackageTabIndexHolder classCategoryList |
|
32 |
packageList classList classListOutGeneratorHolder |
|
33 |
classListInGeneratorHolder modeHolder detailsHolder |
|
34 |
failureListHolder failureSelectionHolder errorListHolder |
|
10235 | 35 |
errorSelectionHolder lastPass resultHolder lastBrowser' |
9953 | 36 |
classVariableNames:'History' |
37 |
poolDictionaries:'' |
|
9955 | 38 |
category:'SUnit-UI' |
9953 | 39 |
! |
40 |
||
41 |
ClassList subclass:#ClassList |
|
42 |
instanceVariableNames:'' |
|
43 |
classVariableNames:'' |
|
44 |
poolDictionaries:'' |
|
45 |
privateIn:TestRunner2 |
|
46 |
! |
|
47 |
||
48 |
ApplicationModel subclass:#ResultList |
|
49 |
instanceVariableNames:'results resultsHolder selectiomHolder listHolder timestampFormat' |
|
50 |
classVariableNames:'' |
|
51 |
poolDictionaries:'' |
|
52 |
privateIn:TestRunner2 |
|
53 |
! |
|
54 |
||
55 |
HierarchicalItem subclass:#ListEntry |
|
56 |
instanceVariableNames:'label realLabel test result' |
|
57 |
classVariableNames:'PassedText FailedText ErrorText' |
|
58 |
poolDictionaries:'' |
|
59 |
privateIn:TestRunner2::ResultList |
|
60 |
! |
|
61 |
||
62 |
!TestRunner2 class methodsFor:'documentation'! |
|
63 |
||
64 |
copyright |
|
65 |
" |
|
10090 | 66 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague |
67 |
Copyright (c) 2009-2010 eXept Software AG |
|
68 |
||
69 |
Permission is hereby granted, free of charge, to any person |
|
70 |
obtaining a copy of this software and associated documentation |
|
71 |
files (the 'Software'), to deal in the Software without |
|
72 |
restriction, including without limitation the rights to use, |
|
73 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
74 |
copies of the Software, and to permit persons to whom the |
|
75 |
Software is furnished to do so, subject to the following |
|
76 |
conditions: |
|
9953 | 77 |
|
10090 | 78 |
The above copyright notice and this permission notice shall be |
79 |
included in all copies or substantial portions of the Software. |
|
80 |
||
81 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
82 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
83 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
84 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
85 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
86 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
87 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
88 |
OTHER DEALINGS IN THE SOFTWARE. |
|
9953 | 89 |
" |
90 |
! ! |
|
91 |
||
92 |
!TestRunner2 class methodsFor:'initialization'! |
|
93 |
||
94 |
initialize |
|
95 |
||
96 |
self initializeHistory. |
|
97 |
||
98 |
Smalltalk addStartBlock: |
|
99 |
[self installInLauncher] |
|
100 |
||
101 |
"Created: / 09-06-2008 / 11:11:19 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
102 |
"Modified: / 26-11-2008 / 09:38:20 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
103 |
"Modified: / 19-03-2010 / 08:46:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
104 |
! |
|
105 |
||
106 |
initializeHistory |
|
107 |
||
108 |
History := List new. |
|
109 |
||
110 |
"Modified: / 26-11-2008 / 09:38:20 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
111 |
"Created: / 19-03-2010 / 08:46:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
112 |
! |
|
113 |
||
114 |
installInLauncher |
|
10513 | 115 |
|menuItem action| |
9953 | 116 |
|
10511 | 117 |
NewLauncher isNil ifTrue:[^ self]. |
10513 | 118 |
ToolbarIconLibrary isNil ifTrue:[^ self]. |
119 |
||
120 |
"Class may be changed, and we want to start the changed class" |
|
121 |
action := (MessageSend receiver:(Smalltalk at:self name) selector:#open). |
|
9953 | 122 |
|
10512 | 123 |
"Install in Tools menu" |
9953 | 124 |
menuItem := (MenuItem label:'SUnit Test Runner (enhanced)') |
10518 | 125 |
nameKey:#TestRunner2; |
10513 | 126 |
labelImage:self startSUnitIcon; |
127 |
value:action; |
|
9953 | 128 |
isButton:false. |
129 |
NewLauncher |
|
130 |
addMenuItem:menuItem |
|
131 |
from:self |
|
132 |
in:'menu.tools.programming' |
|
10512 | 133 |
position:#( after startSUnitTestRunner ) |
9953 | 134 |
space:false. |
135 |
||
136 |
"Install in Toolbar" |
|
137 |
menuItem := (MenuItem new) |
|
10518 | 138 |
nameKey:#TestRunner2; |
10512 | 139 |
"label: 'SUnit Test Runner (enhanced)'" |
10513 | 140 |
icon:self startSUnitIcon; |
141 |
value:action; |
|
9953 | 142 |
isButton:true. |
143 |
NewLauncher |
|
144 |
addMenuItem:menuItem |
|
145 |
from:self |
|
146 |
in:'toolbar' |
|
10512 | 147 |
position:#( before garbageCollect ) |
9953 | 148 |
space:false. |
149 |
||
150 |
"Created: / 09-06-2008 / 11:11:19 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
151 |
"Modified: / 26-11-2008 / 09:38:20 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
152 |
"Modified: / 09-01-2010 / 20:48:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
153 |
! ! |
|
154 |
||
155 |
!TestRunner2 class methodsFor:'image specs'! |
|
156 |
||
157 |
defaultIcon |
|
158 |
||
159 |
^ToolbarIconLibrary sUnit28x28Icon |
|
160 |
||
161 |
"Created: / 19-08-2009 / 14:32:13 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
162 |
! ! |
|
163 |
||
164 |
!TestRunner2 class methodsFor:'interface specs'! |
|
165 |
||
166 |
buttonPaneSpec |
|
167 |
"This resource specification was automatically generated |
|
168 |
by the UIPainter of ST/X." |
|
169 |
||
170 |
"Do not manually edit this!! If it is corrupted, |
|
171 |
the UIPainter may not be able to read the specification." |
|
172 |
||
173 |
" |
|
174 |
UIPainter new openOnClass:Tools::TestRunner2 andSelector:#buttonPaneSpec |
|
175 |
Tools::TestRunner2 new openInterface:#buttonPaneSpec |
|
176 |
" |
|
177 |
||
178 |
<resource: #canvas> |
|
179 |
||
180 |
^ |
|
181 |
#(FullSpec |
|
182 |
name: buttonPaneSpec |
|
183 |
window: |
|
184 |
(WindowSpec |
|
185 |
label: 'Button Spec' |
|
186 |
name: 'Button Spec' |
|
187 |
min: (Point 10 10) |
|
188 |
bounds: (Rectangle 0 0 492 44) |
|
189 |
) |
|
190 |
component: |
|
191 |
(SpecCollection |
|
192 |
collection: ( |
|
193 |
(HorizontalPanelViewSpec |
|
194 |
name: 'ButtonPanel' |
|
195 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
196 |
horizontalLayout: fit |
|
197 |
verticalLayout: fit |
|
198 |
horizontalSpace: 0 |
|
199 |
verticalSpace: 0 |
|
200 |
component: |
|
201 |
(SpecCollection |
|
202 |
collection: ( |
|
203 |
(ActionButtonSpec |
|
204 |
label: 'Run Selected' |
|
205 |
name: 'RunSelected' |
|
206 |
translateLabel: true |
|
207 |
tabable: true |
|
208 |
model: runSelectedAction |
|
209 |
enableChannel: hasTestCasesAspect |
|
210 |
disabledLogo: 'Run Selected' |
|
10143 | 211 |
extent: (Point 98 44) |
9953 | 212 |
) |
213 |
(ActionButtonSpec |
|
10143 | 214 |
label: 'Profiled' |
9953 | 215 |
name: 'RunProfiled' |
216 |
translateLabel: true |
|
217 |
tabable: true |
|
218 |
model: runProfiledAction |
|
219 |
initiallyDisabled: true |
|
10143 | 220 |
extent: (Point 98 44) |
221 |
) |
|
222 |
(ActionButtonSpec |
|
223 |
label: 'Coverage' |
|
224 |
name: 'RunCoverage' |
|
225 |
translateLabel: true |
|
226 |
tabable: true |
|
227 |
model: runCoverageAction |
|
228 |
initiallyDisabled: true |
|
229 |
extent: (Point 99 44) |
|
9953 | 230 |
) |
231 |
(ActionButtonSpec |
|
232 |
label: 'Run Failures' |
|
233 |
name: 'RunFailures' |
|
234 |
translateLabel: true |
|
235 |
tabable: true |
|
236 |
model: runFailuresAction |
|
237 |
initiallyDisabled: true |
|
238 |
enableChannel: hasFailuresAspect |
|
239 |
disabledLogo: 'Run Failures' |
|
10143 | 240 |
extent: (Point 98 44) |
9953 | 241 |
) |
242 |
(ActionButtonSpec |
|
243 |
label: 'Run Errors' |
|
244 |
name: 'RunErrors' |
|
245 |
translateLabel: true |
|
246 |
tabable: true |
|
247 |
model: runErrorsAction |
|
248 |
initiallyDisabled: true |
|
249 |
enableChannel: hasErrorsAspect |
|
250 |
disabledLogo: 'Run Errors' |
|
10143 | 251 |
extent: (Point 99 44) |
9953 | 252 |
) |
253 |
) |
|
254 |
||
255 |
) |
|
256 |
) |
|
257 |
) |
|
258 |
||
259 |
) |
|
260 |
) |
|
261 |
||
10143 | 262 |
"Modified: / 04-07-2011 / 22:39:20 / cg" |
9953 | 263 |
! |
264 |
||
265 |
classCategoryListSpec |
|
266 |
"This resource specification was automatically generated |
|
267 |
by the UIPainter of ST/X." |
|
268 |
||
269 |
"Do not manually edit this!! If it is corrupted, |
|
270 |
the UIPainter may not be able to read the specification." |
|
271 |
||
272 |
" |
|
273 |
UIPainter new openOnClass:Tools::TestRunner2 andSelector:#classCategoryListSpec |
|
274 |
Tools::TestRunner2 new openInterface:#classCategoryListSpec |
|
275 |
" |
|
276 |
||
277 |
<resource: #canvas> |
|
278 |
||
279 |
^ |
|
280 |
#(FullSpec |
|
281 |
name: classCategoryListSpec |
|
282 |
window: |
|
283 |
(WindowSpec |
|
284 |
label: 'Class Category List' |
|
285 |
name: 'Class Category List' |
|
286 |
min: (Point 10 10) |
|
287 |
bounds: (Rectangle 0 0 300 300) |
|
288 |
) |
|
289 |
component: |
|
290 |
(SpecCollection |
|
291 |
collection: ( |
|
292 |
(SubCanvasSpec |
|
293 |
name: 'ClassCategoryList' |
|
294 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
295 |
hasHorizontalScrollBar: false |
|
296 |
hasVerticalScrollBar: false |
|
297 |
clientKey: classCategoryList |
|
298 |
) |
|
299 |
) |
|
300 |
||
301 |
) |
|
302 |
) |
|
303 |
||
304 |
"Modified: / 04-06-2008 / 23:57:50 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
305 |
! |
|
306 |
||
307 |
classListSpec |
|
308 |
"This resource specification was automatically generated |
|
309 |
by the UIPainter of ST/X." |
|
310 |
||
311 |
"Do not manually edit this!! If it is corrupted, |
|
312 |
the UIPainter may not be able to read the specification." |
|
313 |
||
314 |
" |
|
315 |
UIPainter new openOnClass:Tools::TestRunner2 andSelector:#classCategoryListSpec |
|
316 |
Tools::TestRunner2 new openInterface:#classCategoryListSpec |
|
317 |
" |
|
318 |
||
319 |
<resource: #canvas> |
|
320 |
||
321 |
^ |
|
322 |
#(FullSpec |
|
323 |
name: classCategoryListSpec |
|
324 |
window: |
|
325 |
(WindowSpec |
|
326 |
label: 'Class Category List' |
|
327 |
name: 'Class Category List' |
|
328 |
min: (Point 10 10) |
|
329 |
bounds: (Rectangle 0 0 300 300) |
|
330 |
) |
|
331 |
component: |
|
332 |
(SpecCollection |
|
333 |
collection: ( |
|
334 |
(SubCanvasSpec |
|
335 |
name: 'ClassList' |
|
336 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
337 |
hasHorizontalScrollBar: false |
|
338 |
hasVerticalScrollBar: false |
|
339 |
clientKey: classList |
|
340 |
) |
|
341 |
) |
|
342 |
||
343 |
) |
|
344 |
) |
|
345 |
||
346 |
"Created: / 05-06-2008 / 19:30:38 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
347 |
! |
|
348 |
||
349 |
packageListSpec |
|
350 |
"This resource specification was automatically generated |
|
351 |
by the UIPainter of ST/X." |
|
352 |
||
353 |
"Do not manually edit this!! If it is corrupted, |
|
354 |
the UIPainter may not be able to read the specification." |
|
355 |
||
356 |
" |
|
357 |
UIPainter new openOnClass:Tools::TestRunner2 andSelector:#packageListSpec |
|
358 |
Tools::TestRunner2 new openInterface:#packageListSpec |
|
359 |
" |
|
360 |
||
361 |
<resource: #canvas> |
|
362 |
||
363 |
^ |
|
364 |
#(FullSpec |
|
365 |
name: packageListSpec |
|
366 |
window: |
|
367 |
(WindowSpec |
|
368 |
label: 'Package List' |
|
369 |
name: 'Package List' |
|
370 |
min: (Point 10 10) |
|
371 |
bounds: (Rectangle 0 0 300 300) |
|
372 |
) |
|
373 |
component: |
|
374 |
(SpecCollection |
|
375 |
collection: ( |
|
376 |
(SubCanvasSpec |
|
377 |
name: 'PackageList' |
|
378 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
379 |
hasHorizontalScrollBar: false |
|
380 |
hasVerticalScrollBar: false |
|
381 |
clientKey: packageList |
|
382 |
) |
|
383 |
) |
|
384 |
||
385 |
) |
|
386 |
) |
|
387 |
||
388 |
"Modified: / 05-06-2008 / 00:14:06 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
389 |
! |
|
390 |
||
391 |
resultPaneSpec |
|
392 |
"This resource specification was automatically generated |
|
393 |
by the UIPainter of ST/X." |
|
394 |
||
395 |
"Do not manually edit this!! If it is corrupted, |
|
396 |
the UIPainter may not be able to read the specification." |
|
397 |
||
398 |
" |
|
399 |
UIPainter new openOnClass:TestRunner2 andSelector:#resultPaneSpec |
|
400 |
TestRunner2 new openInterface:#resultPaneSpec |
|
401 |
" |
|
402 |
||
403 |
<resource: #canvas> |
|
404 |
||
405 |
^ |
|
406 |
#(FullSpec |
|
407 |
name: resultPaneSpec |
|
408 |
window: |
|
409 |
(WindowSpec |
|
410 |
label: 'Result spec' |
|
411 |
name: 'Result spec' |
|
412 |
min: (Point 10 10) |
|
413 |
bounds: (Rectangle 0 0 300 300) |
|
414 |
) |
|
415 |
component: |
|
416 |
(SpecCollection |
|
417 |
collection: ( |
|
418 |
(LabelSpec |
|
419 |
label: 'N/A' |
|
420 |
name: 'Mode' |
|
421 |
layout: (LayoutFrame 0 0 0 0 0 1 0 0.6) |
|
422 |
style: (FontDescription Arial bold roman 14) |
|
423 |
labelChannel: modeHolder |
|
424 |
) |
|
425 |
(LabelSpec |
|
426 |
label: '...' |
|
427 |
name: 'Details' |
|
428 |
layout: (LayoutFrame 0 0 0 0.6 0 1 0 1) |
|
429 |
labelChannel: detailsHolder |
|
430 |
) |
|
431 |
) |
|
432 |
||
433 |
) |
|
434 |
) |
|
435 |
||
436 |
"Modified: / 18-01-2008 / 18:44:00 / janfrog" |
|
437 |
! |
|
438 |
||
439 |
testHistoryTabSpec |
|
440 |
"This resource specification was automatically generated |
|
441 |
by the UIPainter of ST/X." |
|
442 |
||
443 |
"Do not manually edit this!! If it is corrupted, |
|
444 |
the UIPainter may not be able to read the specification." |
|
445 |
||
446 |
" |
|
447 |
UIPainter new openOnClass:Tools::TestRunner2 andSelector:#testHistoryTabSpec |
|
448 |
Tools::TestRunner2 new openInterface:#testHistoryTabSpec |
|
449 |
" |
|
450 |
||
451 |
<resource: #canvas> |
|
452 |
||
453 |
^ |
|
454 |
#(FullSpec |
|
455 |
name: testHistoryTabSpec |
|
456 |
window: |
|
457 |
(WindowSpec |
|
458 |
label: 'Test History' |
|
459 |
name: 'Test History' |
|
460 |
min: (Point 10 10) |
|
461 |
bounds: (Rectangle 0 0 300 300) |
|
462 |
) |
|
463 |
component: |
|
464 |
(SpecCollection |
|
465 |
collection: ( |
|
466 |
(SubCanvasSpec |
|
467 |
name: 'ResultList' |
|
468 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
469 |
hasHorizontalScrollBar: false |
|
470 |
hasVerticalScrollBar: false |
|
471 |
majorKey: #'Tools::TestRunner2::ResultList' |
|
472 |
subAspectHolders: |
|
473 |
(Array |
|
474 |
||
475 |
(SubChannelInfoSpec |
|
476 |
subAspect: resultsHolder |
|
477 |
aspect: historyHolder |
|
478 |
) |
|
479 |
) |
|
480 |
createNewApplication: true |
|
481 |
createNewBuilder: true |
|
482 |
) |
|
483 |
) |
|
484 |
||
485 |
) |
|
486 |
) |
|
487 |
! |
|
488 |
||
489 |
testResultTabSpec |
|
490 |
"This resource specification was automatically generated |
|
491 |
by the UIPainter of ST/X." |
|
492 |
||
493 |
"Do not manually edit this!! If it is corrupted, |
|
494 |
the UIPainter may not be able to read the specification." |
|
495 |
||
496 |
" |
|
497 |
UIPainter new openOnClass:Tools::TestRunner2 andSelector:#testResultTabSpec |
|
498 |
Tools::TestRunner2 new openInterface:#testResultTabSpec |
|
499 |
" |
|
500 |
||
501 |
<resource: #canvas> |
|
502 |
||
503 |
^ |
|
504 |
#(FullSpec |
|
505 |
name: testResultTabSpec |
|
506 |
window: |
|
507 |
(WindowSpec |
|
508 |
label: 'Test Result' |
|
509 |
name: 'Test Result' |
|
510 |
min: (Point 10 10) |
|
511 |
bounds: (Rectangle 0 0 300 300) |
|
512 |
) |
|
513 |
component: |
|
514 |
(SpecCollection |
|
515 |
collection: ( |
|
516 |
(SubCanvasSpec |
|
517 |
name: 'ResultList' |
|
518 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
519 |
hasHorizontalScrollBar: false |
|
520 |
hasVerticalScrollBar: false |
|
521 |
majorKey: #'Tools::TestRunner2::ResultList' |
|
522 |
subAspectHolders: |
|
523 |
(Array |
|
524 |
||
525 |
(SubChannelInfoSpec |
|
526 |
subAspect: resultsHolder |
|
527 |
aspect: resultHolder |
|
528 |
) |
|
529 |
) |
|
530 |
createNewApplication: true |
|
531 |
createNewBuilder: true |
|
532 |
) |
|
533 |
) |
|
534 |
||
535 |
) |
|
536 |
) |
|
537 |
||
538 |
"Modified: / 19-03-2010 / 08:32:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
539 |
! |
|
540 |
||
541 |
windowSpec |
|
542 |
"This resource specification was automatically generated |
|
543 |
by the UIPainter of ST/X." |
|
544 |
||
545 |
"Do not manually edit this!! If it is corrupted, |
|
546 |
the UIPainter may not be able to read the specification." |
|
547 |
||
548 |
" |
|
549 |
UIPainter new openOnClass:Tools::TestRunner2 andSelector:#windowSpec |
|
550 |
Tools::TestRunner2 new openInterface:#windowSpec |
|
551 |
Tools::TestRunner2 open |
|
552 |
" |
|
553 |
||
554 |
<resource: #canvas> |
|
555 |
||
556 |
^ |
|
557 |
#(FullSpec |
|
558 |
name: windowSpec |
|
559 |
window: |
|
560 |
(WindowSpec |
|
561 |
label: 'Test Runner Too' |
|
562 |
name: 'Test Runner Too' |
|
563 |
min: (Point 0 0) |
|
564 |
bounds: (Rectangle 0 0 717 412) |
|
565 |
menu: mainMenu |
|
566 |
icon: defaultIcon |
|
567 |
) |
|
568 |
component: |
|
569 |
(SpecCollection |
|
570 |
collection: ( |
|
571 |
(UISubSpecification |
|
572 |
name: 'ResultPane' |
|
573 |
layout: (LayoutFrame 0 0 0 0 0 1 100 0) |
|
574 |
minorKey: resultPaneSpec |
|
575 |
) |
|
576 |
(VariableHorizontalPanelSpec |
|
577 |
name: 'ListPane' |
|
578 |
layout: (LayoutFrame 0 0 100 0 0 1 -30 1) |
|
579 |
showHandle: true |
|
580 |
snapMode: both |
|
581 |
handlePosition: right |
|
582 |
component: |
|
583 |
(SpecCollection |
|
584 |
collection: ( |
|
585 |
(NoteBookViewSpec |
|
586 |
name: 'ClassOrPackageTab' |
|
587 |
model: classCategoryOrPackageTabIndexHolder |
|
588 |
menu: classCategoryOrPackageTabList |
|
589 |
useIndex: true |
|
590 |
fitLastRow: false |
|
591 |
) |
|
592 |
(TransparentBoxSpec |
|
593 |
name: 'ClassListBox' |
|
594 |
component: |
|
595 |
(SpecCollection |
|
596 |
collection: ( |
|
597 |
(SubCanvasSpec |
|
598 |
name: 'ClassList' |
|
599 |
layout: (LayoutFrame 0 0 25 0 0 1 0 1) |
|
600 |
hasHorizontalScrollBar: false |
|
601 |
hasVerticalScrollBar: false |
|
602 |
clientKey: classList |
|
603 |
createNewBuilder: false |
|
604 |
) |
|
605 |
) |
|
606 |
||
607 |
) |
|
608 |
) |
|
609 |
(NoteBookViewSpec |
|
610 |
name: 'NoteBook2' |
|
611 |
menu: resultAndHistoryTabList |
|
612 |
) |
|
613 |
) |
|
614 |
||
615 |
) |
|
616 |
handles: (Any 0.33333333333333 0.66666666666667 1.0) |
|
617 |
) |
|
618 |
(UISubSpecification |
|
619 |
name: 'ButtonPane' |
|
620 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
|
621 |
minorKey: buttonPaneSpec |
|
622 |
) |
|
623 |
) |
|
624 |
||
625 |
) |
|
626 |
) |
|
627 |
! |
|
628 |
||
629 |
windowSpec_old |
|
630 |
"This resource specification was automatically generated |
|
631 |
by the UIPainter of ST/X." |
|
632 |
||
633 |
"Do not manually edit this!! If it is corrupted, |
|
634 |
the UIPainter may not be able to read the specification." |
|
635 |
||
636 |
" |
|
637 |
UIPainter new openOnClass:Tools::TestRunner2 andSelector:#windowSpec |
|
638 |
Tools::TestRunner2 new openInterface:#windowSpec |
|
639 |
Tools::TestRunner2 open |
|
640 |
" |
|
641 |
||
642 |
<resource: #canvas> |
|
643 |
||
644 |
^ |
|
645 |
#(FullSpec |
|
646 |
name: windowSpec |
|
647 |
window: |
|
648 |
(WindowSpec |
|
649 |
label: 'Test Runner Too' |
|
650 |
name: 'Test Runner Too' |
|
651 |
min: (Point 0 0) |
|
652 |
bounds: (Rectangle 0 0 717 412) |
|
653 |
icon: defaultIcon |
|
654 |
) |
|
655 |
component: |
|
656 |
(SpecCollection |
|
657 |
collection: ( |
|
658 |
(UISubSpecification |
|
659 |
name: 'ResultPane' |
|
660 |
layout: (LayoutFrame 0 0 0 0 0 1 100 0) |
|
661 |
minorKey: resultPaneSpec |
|
662 |
) |
|
663 |
(VariableHorizontalPanelSpec |
|
664 |
name: 'ListPane' |
|
665 |
layout: (LayoutFrame 0 0 100 0 0 1 -30 1) |
|
666 |
showHandle: true |
|
667 |
snapMode: both |
|
668 |
component: |
|
669 |
(SpecCollection |
|
670 |
collection: ( |
|
671 |
(NoteBookViewSpec |
|
672 |
name: 'ClassOrPackageTab' |
|
673 |
model: classCategoryOrPackageTabIndexHolder |
|
674 |
menu: classCategoryOrPackageTabList |
|
675 |
direction: left |
|
676 |
useIndex: true |
|
677 |
fitLastRow: false |
|
678 |
) |
|
679 |
(SubCanvasSpec |
|
680 |
name: 'ClassList' |
|
681 |
hasHorizontalScrollBar: false |
|
682 |
hasVerticalScrollBar: false |
|
683 |
clientKey: classList |
|
684 |
createNewBuilder: false |
|
685 |
) |
|
686 |
(VariableVerticalPanelSpec |
|
687 |
name: 'VariableVerticalPanel1' |
|
688 |
component: |
|
689 |
(SpecCollection |
|
690 |
collection: ( |
|
691 |
(SequenceViewSpec |
|
692 |
name: 'FailuresList' |
|
693 |
model: failureSelectionHolder |
|
694 |
hasHorizontalScrollBar: true |
|
695 |
hasVerticalScrollBar: true |
|
696 |
doubleClickSelector: debugFailure: |
|
697 |
useIndex: false |
|
698 |
sequenceList: failureListHolder |
|
699 |
) |
|
700 |
(SequenceViewSpec |
|
701 |
name: 'ErrorsList' |
|
702 |
model: errorSelectionHolder |
|
703 |
hasHorizontalScrollBar: true |
|
704 |
hasVerticalScrollBar: true |
|
705 |
doubleClickSelector: debugError: |
|
706 |
useIndex: false |
|
707 |
sequenceList: errorListHolder |
|
708 |
) |
|
709 |
) |
|
710 |
||
711 |
) |
|
712 |
handles: (Any 0.5 1.0) |
|
713 |
) |
|
714 |
) |
|
715 |
||
716 |
) |
|
717 |
handles: (Any 0.33333333333333 0.66666666666667 1.0) |
|
718 |
) |
|
719 |
(UISubSpecification |
|
720 |
name: 'ButtonPane' |
|
721 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
|
722 |
minorKey: buttonPaneSpec |
|
723 |
) |
|
724 |
) |
|
725 |
||
726 |
) |
|
727 |
) |
|
728 |
||
729 |
"Created: / 07-02-2010 / 14:48:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
730 |
! ! |
|
731 |
||
732 |
!TestRunner2 class methodsFor:'list specs'! |
|
733 |
||
734 |
classCategoryOrPackageTabList |
|
735 |
"This resource specification was automatically generated |
|
736 |
by the TabListEditor of ST/X." |
|
737 |
||
738 |
"Do not manually edit this!! If it is corrupted, |
|
739 |
the TabListEditor may not be able to read the specification." |
|
740 |
||
741 |
" |
|
742 |
TabListEditor new openOnClass: self andSelector:#classCategoryOrPackageTabList |
|
743 |
" |
|
744 |
||
745 |
<resource: #tabList> |
|
746 |
||
747 |
^ #( |
|
748 |
(TabItem |
|
749 |
label: 'Categories' |
|
750 |
minorKey: classCategoryListSpec |
|
751 |
createNewBuilder: false |
|
752 |
) |
|
753 |
(TabItem |
|
754 |
label: 'Packages' |
|
755 |
minorKey: packageListSpec |
|
756 |
createNewBuilder: false |
|
757 |
) |
|
758 |
) |
|
759 |
||
760 |
collect:[:aTab| TabItem new fromLiteralArrayEncoding:aTab ] |
|
761 |
||
762 |
"Modified: / 05-06-2008 / 00:15:05 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
763 |
! |
|
764 |
||
765 |
resultAndHistoryTabList |
|
766 |
"This resource specification was automatically generated |
|
767 |
by the TabListEditor of ST/X." |
|
768 |
||
769 |
"Do not manually edit this!! If it is corrupted, |
|
770 |
the TabListEditor may not be able to read the specification." |
|
771 |
||
772 |
" |
|
773 |
TabListEditor new openOnClass: self andSelector:#resultAndHistoryTabList |
|
774 |
" |
|
775 |
||
776 |
<resource: #tabList> |
|
777 |
||
778 |
^ #( |
|
779 |
(TabItem |
|
780 |
label: 'Result' |
|
781 |
minorKey: testResultTabSpec |
|
782 |
createNewBuilder: false |
|
783 |
) |
|
784 |
(TabItem |
|
785 |
label: 'History' |
|
786 |
minorKey: testHistoryTabSpec |
|
787 |
createNewBuilder: false |
|
788 |
) |
|
789 |
) |
|
790 |
||
791 |
collect:[:aTab| TabItem new fromLiteralArrayEncoding:aTab ] |
|
792 |
! ! |
|
793 |
||
794 |
!TestRunner2 class methodsFor:'menu specs'! |
|
795 |
||
9958 | 796 |
classListMenu |
797 |
"This resource specification was automatically generated |
|
798 |
by the MenuEditor of ST/X." |
|
799 |
||
800 |
"Do not manually edit this!! If it is corrupted, |
|
801 |
the MenuEditor may not be able to read the specification." |
|
802 |
||
803 |
" |
|
804 |
MenuEditor new openOnClass:Tools::TestRunner2 andSelector:#classListMenu |
|
805 |
(Menu new fromLiteralArrayEncoding:(Tools::TestRunner2 classListMenu)) startUp |
|
806 |
" |
|
807 |
||
808 |
<resource: #menu> |
|
809 |
||
810 |
^ |
|
811 |
#(Menu |
|
812 |
( |
|
813 |
(MenuItem |
|
814 |
label: 'Browse' |
|
815 |
itemValue: classListMenuBrowse |
|
816 |
translateLabel: true |
|
817 |
) |
|
818 |
) |
|
819 |
nil |
|
820 |
nil |
|
821 |
) |
|
822 |
! |
|
823 |
||
9953 | 824 |
mainMenu |
825 |
"This resource specification was automatically generated |
|
826 |
by the MenuEditor of ST/X." |
|
827 |
||
828 |
"Do not manually edit this!! If it is corrupted, |
|
829 |
the MenuEditor may not be able to read the specification." |
|
830 |
||
831 |
" |
|
832 |
MenuEditor new openOnClass:Tools::TestRunner2 andSelector:#mainMenu |
|
833 |
(Menu new fromLiteralArrayEncoding:(Tools::TestRunner2 mainMenu)) startUp |
|
834 |
" |
|
835 |
||
836 |
<resource: #menu> |
|
837 |
||
838 |
^ |
|
839 |
#(Menu |
|
840 |
( |
|
841 |
(MenuItem |
|
842 |
label: 'File' |
|
843 |
translateLabel: true |
|
844 |
submenu: |
|
845 |
(Menu |
|
846 |
( |
|
847 |
(MenuItem |
|
848 |
label: 'Exit' |
|
849 |
itemValue: closeRequest |
|
850 |
translateLabel: true |
|
851 |
) |
|
852 |
) |
|
853 |
nil |
|
854 |
nil |
|
855 |
) |
|
856 |
) |
|
857 |
(MenuItem |
|
858 |
label: 'Help' |
|
859 |
translateLabel: true |
|
860 |
startGroup: conditionalRight |
|
861 |
submenu: |
|
862 |
(Menu |
|
863 |
( |
|
864 |
(MenuItem |
|
865 |
label: 'Documentation' |
|
866 |
itemValue: openDocumentation |
|
867 |
translateLabel: true |
|
868 |
) |
|
869 |
(MenuItem |
|
870 |
label: '-' |
|
871 |
) |
|
872 |
(MenuItem |
|
873 |
label: 'About this Application...' |
|
874 |
itemValue: openAboutThisApplication |
|
875 |
translateLabel: true |
|
876 |
) |
|
877 |
) |
|
878 |
nil |
|
879 |
nil |
|
880 |
) |
|
881 |
) |
|
882 |
) |
|
883 |
nil |
|
884 |
nil |
|
885 |
) |
|
886 |
! |
|
887 |
||
888 |
packageListMenu |
|
889 |
"This resource specification was automatically generated |
|
890 |
by the MenuEditor of ST/X." |
|
891 |
||
892 |
"Do not manually edit this!! If it is corrupted, |
|
893 |
the MenuEditor may not be able to read the specification." |
|
894 |
||
895 |
" |
|
896 |
MenuEditor new openOnClass:Tools::TestRunner2 andSelector:#packageListMenu |
|
897 |
(Menu new fromLiteralArrayEncoding:(Tools::TestRunner2 packageListMenu)) startUp |
|
898 |
" |
|
899 |
||
900 |
<resource: #menu> |
|
901 |
||
902 |
^ |
|
903 |
#(Menu |
|
904 |
( |
|
905 |
(MenuItem |
|
906 |
label: 'Select prerequisites' |
|
907 |
itemValue: packageListMenuSelectPrerequisites |
|
908 |
translateLabel: true |
|
909 |
) |
|
910 |
(MenuItem |
|
911 |
label: 'Select prerequisites (recursive)' |
|
912 |
itemValue: packageListMenuSelectPrerequisitesAll |
|
913 |
translateLabel: true |
|
914 |
) |
|
915 |
(MenuItem |
|
916 |
label: 'Select dependents' |
|
917 |
itemValue: packageListMenuSelectDependents |
|
918 |
translateLabel: true |
|
919 |
) |
|
920 |
(MenuItem |
|
921 |
label: 'Select dependents (recursively)' |
|
922 |
itemValue: packageListMenuSelectDependentsAll |
|
923 |
translateLabel: true |
|
924 |
) |
|
925 |
) |
|
926 |
nil |
|
927 |
nil |
|
928 |
) |
|
929 |
||
930 |
"Modified: / 06-06-2008 / 20:04:49 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
931 |
! ! |
|
932 |
||
10513 | 933 |
!TestRunner2 class methodsFor:'resources'! |
934 |
||
935 |
startSUnitIcon |
|
936 |
<resource: #programImage> |
|
937 |
||
938 |
^ ToolbarIconLibrary sUnit24x24Icon |
|
939 |
"/ ^ ToolbarIconLibrary sUnit28x28Icon |
|
940 |
! ! |
|
941 |
||
10197 | 942 |
!TestRunner2 class methodsFor:'startup'! |
943 |
||
944 |
openOnTestCase:aTestCaseClass |
|
945 |
|runner| |
|
946 |
||
947 |
runner := self new. |
|
948 |
runner allButOpen. |
|
10225
98fa6a2c2147
comment/format in: #runCoverageAction
Claus Gittinger <cg@exept.de>
parents:
10197
diff
changeset
|
949 |
runner packageList selectedProjects value:(Array with:aTestCaseClass package). |
10197 | 950 |
runner classList selectClass:aTestCaseClass. |
951 |
runner openWindow. |
|
952 |
||
953 |
"Created: / 06-07-2011 / 14:10:00 / cg" |
|
954 |
! ! |
|
955 |
||
9953 | 956 |
!TestRunner2 methodsFor:'accessing'! |
957 |
||
958 |
errorColor |
|
959 |
^ self class |
|
960 |
errorColor |
|
961 |
||
962 |
"Modified: / 08-02-2010 / 13:57:26 / Jan Vrany <jan,vrany@fit.cvut.cz>" |
|
963 |
! |
|
964 |
||
965 |
errorTestSuite |
|
966 |
||
967 |
| testSuite | |
|
968 |
testSuite := TestSuite new. |
|
969 |
errorListHolder value do: |
|
970 |
[:test| |
|
971 |
testSuite addTest: test]. |
|
972 |
^testSuite |
|
973 |
||
974 |
"Created: / 06-06-2008 / 09:08:40 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
975 |
! |
|
976 |
||
977 |
failedColor |
|
978 |
^ self class failedColor |
|
979 |
! |
|
980 |
||
981 |
failureTestSuite |
|
982 |
||
983 |
| testSuite | |
|
984 |
testSuite := TestSuite new. |
|
985 |
failureListHolder value do: |
|
986 |
[:test| |
|
987 |
testSuite addTest: test]. |
|
988 |
^testSuite |
|
989 |
||
990 |
"Created: / 06-06-2008 / 09:03:55 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
991 |
! |
|
992 |
||
993 |
passedColor |
|
994 |
^ self class passedColor |
|
995 |
! |
|
996 |
||
997 |
selectedPackages: packages |
|
998 |
||
999 |
self packageList selectedProjects value: packages. |
|
1000 |
"/self packageList updateTreeSelection. |
|
1001 |
||
1002 |
"Created: / 06-06-2008 / 20:02:46 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1003 |
! |
|
1004 |
||
1005 |
selectedTestCases |
|
1006 |
||
1007 |
| testCases | |
|
1008 |
testCases := self classList selectionHolder value. |
|
10452
a2ce7970a068
changed: #selectedTestCases
Claus Gittinger <cg@exept.de>
parents:
10273
diff
changeset
|
1009 |
testCases isEmptyOrNil ifTrue: |
9953 | 1010 |
[testCases := self classList listOfClasses]. |
10143 | 1011 |
testCases := testCases collect:[:cls|cls theNonMetaclass]. |
1012 |
^testCases reject:[:cls | cls isAbstract] |
|
9953 | 1013 |
|
1014 |
"Created: / 05-06-2008 / 22:02:24 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1015 |
"Modified: / 27-11-2008 / 17:16:52 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
10452
a2ce7970a068
changed: #selectedTestCases
Claus Gittinger <cg@exept.de>
parents:
10273
diff
changeset
|
1016 |
"Modified: / 04-08-2011 / 19:05:53 / cg" |
9953 | 1017 |
! |
1018 |
||
1019 |
selectedTestSuite |
|
1020 |
|testCases testSuite| |
|
1021 |
||
1022 |
testCases := self selectedTestCases. |
|
1023 |
testSuite := TestSuite named:(self suiteNameFromClasses:testCases). |
|
1024 |
testCases |
|
1025 |
do:[:testCaseCls | testSuite addTests:((self buildSuiteFromClass:testCaseCls) tests) ]. |
|
1026 |
^ testSuite |
|
1027 |
||
1028 |
"Created: / 05-06-2008 / 22:13:25 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1029 |
"Modified: / 06-06-2008 / 19:28:29 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1030 |
"Modified: / 19-03-2010 / 08:06:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1031 |
! |
|
1032 |
||
1033 |
theSingleSelectedProject |
|
1034 |
||
1035 |
| selection | |
|
1036 |
selection := self packageList selectionHolder value. |
|
1037 |
^selection size = 1 |
|
1038 |
ifTrue:[selection anyOne] |
|
1039 |
ifFalse:[nil] |
|
1040 |
||
1041 |
"Created: / 06-06-2008 / 20:08:07 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1042 |
! |
|
1043 |
||
1044 |
theSingleSelectedProjectDefinition |
|
1045 |
||
1046 |
|package| |
|
1047 |
||
1048 |
package := self theSingleSelectedProject. |
|
1049 |
package ifNil:[^nil]. |
|
1050 |
^Smalltalk at:(ProjectDefinition initialClassNameForDefinitionOf:package) asSymbol |
|
1051 |
||
1052 |
"Created: / 06-06-2008 / 20:08:41 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1053 |
! ! |
|
1054 |
||
1055 |
!TestRunner2 methodsFor:'accessing - lists'! |
|
1056 |
||
1057 |
allTestCategories |
|
1058 |
||
1059 |
| categories | |
|
1060 |
categories := Set new. |
|
1061 |
Smalltalk allClassesDo: |
|
1062 |
[:cls| |
|
1063 |
(self isTestCaseLike: cls) ifTrue: |
|
1064 |
[categories add: cls category]]. |
|
1065 |
^categories |
|
1066 |
||
1067 |
"Modified: / 28-02-2011 / 21:25:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1068 |
! |
|
1069 |
||
1070 |
allTestPackages |
|
1071 |
||
1072 |
| packages | |
|
1073 |
packages := Set new. |
|
1074 |
Smalltalk allClassesDo: |
|
1075 |
[:cls| |
|
1076 |
(self isTestCaseLike: cls) ifTrue: |
|
1077 |
[packages add: cls package]]. |
|
1078 |
^packages |
|
1079 |
||
1080 |
"Modified: / 28-02-2011 / 21:25:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1081 |
! |
|
1082 |
||
1083 |
classCategoryList |
|
1084 |
classCategoryList ifNil: |
|
1085 |
[ classCategoryList := Tools::ClassCategoryList new. |
|
1086 |
classCategoryList inGeneratorHolder:self allTestCategories asSet asValue. |
|
1087 |
classCategoryList outGeneratorHolder:self classListOutGeneratorHolder. |
|
1088 |
classCategoryList doubleClickChannel: |
|
1089 |
[:category | |
|
1090 |
self classList selectionHolder value:#(). |
|
1091 |
self runSelectedAction ] ]. |
|
1092 |
^ classCategoryList |
|
1093 |
||
1094 |
"Created: / 04-06-2008 / 23:56:03 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1095 |
"Modified: / 06-06-2008 / 09:51:42 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1096 |
"Modified: / 01-02-2010 / 09:48:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1097 |
! |
|
1098 |
||
1099 |
classList |
|
9958 | 1100 |
classList isNil ifTrue:[ |
1101 |
classList := Tools::TestRunner2::ClassList new. |
|
1102 |
classList immediateUpdate:true. |
|
1103 |
classList inGeneratorHolder:self classListInGeneratorHolder. |
|
1104 |
classList doubleClickChannel:[:testCase | self runSelectedAction]. |
|
1105 |
classList menuHolder:[ self class classListMenu ]. |
|
10143 | 1106 |
classList selectionHolder onChangeSend:#classSelectionChanged to:self. |
9958 | 1107 |
]. |
1108 |
^ classList |
|
9953 | 1109 |
|
1110 |
"Created: / 05-06-2008 / 19:28:39 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1111 |
"Modified: / 27-11-2008 / 17:22:30 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1112 |
"Modified: / 09-01-2010 / 20:30:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10143 | 1113 |
"Modified: / 04-07-2011 / 22:58:46 / cg" |
9953 | 1114 |
! |
1115 |
||
1116 |
packageList |
|
1117 |
packageList ifNil: |
|
1118 |
[ packageList := Tools::ProjectList new. |
|
1119 |
packageList |
|
1120 |
inGeneratorHolder:(Iterator |
|
1121 |
on:[:whatToDo | self allTestPackages do:[:p | whatToDo value:p ]]) |
|
1122 |
asValue. |
|
1123 |
packageList outGeneratorHolder:self classListOutGeneratorHolder. |
|
1124 |
packageList doubleClickChannel: |
|
1125 |
[:category | |
|
1126 |
self classList selectionHolder value:#(). |
|
1127 |
self runSelectedAction ]. |
|
1128 |
packageList menuHolder:[ self menuFor:#packageListMenu ] ]. |
|
1129 |
^ packageList |
|
1130 |
||
1131 |
"Created: / 05-06-2008 / 00:12:54 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1132 |
"Modified: / 19-08-2009 / 08:46:43 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1133 |
"Modified: / 28-02-2011 / 21:13:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1134 |
! ! |
|
1135 |
||
1136 |
!TestRunner2 methodsFor:'accessing - menus'! |
|
1137 |
||
1138 |
packageListMenu |
|
1139 |
||
1140 |
^self class packageListMenu |
|
1141 |
||
1142 |
"Created: / 06-06-2008 / 19:16:28 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1143 |
! ! |
|
1144 |
||
1145 |
!TestRunner2 methodsFor:'actions'! |
|
1146 |
||
1147 |
debugError: test |
|
1148 |
||
1149 |
| caughtEx | |
|
1150 |
caughtEx := nil. |
|
1151 |
[ |
|
1152 |
test debug |
|
1153 |
] on: GenericException do:[:ex| |
|
1154 |
caughtEx := ex. |
|
1155 |
ex pass |
|
1156 |
]. |
|
1157 |
caughtEx ifNil: |
|
1158 |
[errorListHolder value remove: test. |
|
1159 |
errorListHolder changed]. |
|
1160 |
((caughtEx isKindOf: TestResult resumableFailure) |
|
1161 |
or:[caughtEx isKindOf: TestResult failure]) ifTrue: |
|
1162 |
[errorListHolder value remove: test. |
|
1163 |
errorListHolder changed. |
|
1164 |
failureListHolder value add: test. |
|
1165 |
failureListHolder changed]. |
|
1166 |
||
1167 |
"Created: / 06-06-2008 / 09:19:53 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1168 |
! |
|
1169 |
||
1170 |
debugFailure: test |
|
1171 |
||
1172 |
| caughtEx | |
|
1173 |
caughtEx := nil. |
|
1174 |
[ |
|
1175 |
test debug |
|
1176 |
] on: GenericException do:[:ex| |
|
1177 |
caughtEx := ex. |
|
1178 |
ex pass |
|
1179 |
]. |
|
1180 |
caughtEx ifNil: |
|
1181 |
[failureListHolder value remove: test. |
|
1182 |
failureListHolder changed]. |
|
1183 |
||
1184 |
"Created: / 06-06-2008 / 09:20:00 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1185 |
! |
|
1186 |
||
10143 | 1187 |
runCoverageAction |
10235 | 1188 |
| allCoveredClasses browser result| |
10143 | 1189 |
|
1190 |
allCoveredClasses := OrderedCollection new. |
|
1191 |
self selectedTestCases do:[:eachClass | |
|
10273
83fad2bd03bd
changed: #runCoverageAction
Claus Gittinger <cg@exept.de>
parents:
10239
diff
changeset
|
1192 |
eachClass coveredClasses do:[:cls | cls autoload]. |
10143 | 1193 |
allCoveredClasses addAll:(eachClass coveredClasses). |
1194 |
]. |
|
1195 |
||
10238
1cf700fc8af5
changed: #runCoverageAction
Claus Gittinger <cg@exept.de>
parents:
10235
diff
changeset
|
1196 |
(lastBrowser notNil |
1cf700fc8af5
changed: #runCoverageAction
Claus Gittinger <cg@exept.de>
parents:
10235
diff
changeset
|
1197 |
and:[ lastBrowser window isOpen]) ifTrue:[ |
10235 | 1198 |
browser := lastBrowser. |
10239
775fafd92d7c
changed: #runCoverageAction
Claus Gittinger <cg@exept.de>
parents:
10238
diff
changeset
|
1199 |
browser window topView raiseDeiconified. |
10235 | 1200 |
] ifFalse:[ |
1201 |
browser := NewSystemBrowser browseClasses:allCoveredClasses. |
|
1202 |
lastBrowser := browser. |
|
1203 |
]. |
|
1204 |
||
1205 |
browser showCoverageInformation value:true. |
|
10143 | 1206 |
browser selectClasses:allCoveredClasses. |
10235 | 1207 |
browser window topView raise. |
1208 |
||
10143 | 1209 |
allCoveredClasses do:[:eachClass | |
1210 |
browser recompileClassWithInstrumentation:eachClass |
|
1211 |
]. |
|
1212 |
||
1213 |
self withWaitCursorDo:[ |
|
1214 |
result := self runSuite: self selectedTestSuite. |
|
1215 |
History add: result. |
|
1216 |
]. |
|
1217 |
||
1218 |
"Modified: / 18-01-2008 / 18:38:08 / janfrog" |
|
1219 |
"Modified: / 06-06-2008 / 08:51:42 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1220 |
"Modified: / 19-03-2010 / 08:44:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1221 |
"Created: / 04-07-2011 / 23:04:22 / cg" |
|
1222 |
! |
|
1223 |
||
9953 | 1224 |
runErrorsAction |
1225 |
"akce na tlacitku Run Errors" |
|
1226 |
||
1227 |
self runSuite: self errorTestSuite keepFailures: true keepErrors: false |
|
1228 |
||
1229 |
"Modified: / 18-01-2008 / 18:38:33 / janfrog" |
|
1230 |
"Modified: / 06-06-2008 / 09:13:30 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1231 |
! |
|
1232 |
||
1233 |
runFailuresAction |
|
1234 |
"akce na tlacitku Run Failures" |
|
1235 |
||
1236 |
self runSuite: self failureTestSuite keepFailures: false keepErrors: true |
|
1237 |
||
1238 |
"Modified: / 18-01-2008 / 18:38:40 / janfrog" |
|
1239 |
"Modified: / 06-06-2008 / 09:13:57 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1240 |
! |
|
1241 |
||
1242 |
runProfiledAction |
|
1243 |
"akce na tlacitku Run Profiled" |
|
1244 |
self shouldImplement. |
|
1245 |
! |
|
1246 |
||
1247 |
runSelectedAction |
|
1248 |
||
1249 |
| result | |
|
10143 | 1250 |
|
9953 | 1251 |
result := self runSuite: self selectedTestSuite. |
1252 |
History add: result. |
|
1253 |
||
1254 |
"Modified: / 18-01-2008 / 18:38:08 / janfrog" |
|
1255 |
"Modified: / 06-06-2008 / 08:51:42 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1256 |
"Modified: / 19-03-2010 / 08:44:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10143 | 1257 |
"Modified: / 04-07-2011 / 23:04:46 / cg" |
9953 | 1258 |
! |
1259 |
||
1260 |
runSuite: aTestSuite |
|
1261 |
||
1262 |
^self runSuite: aTestSuite keepFailures: false keepErrors: false |
|
1263 |
||
1264 |
"Modified: / 18-01-2008 / 18:38:08 / janfrog" |
|
1265 |
"Modified: / 06-06-2008 / 09:12:17 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1266 |
"Modified: / 19-03-2010 / 08:44:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1267 |
! |
|
1268 |
||
1269 |
runSuite: aTestSuite keepFailures: keepFailures keepErrors: keepErrors |
|
10143 | 1270 |
| testResult testCases | |
9953 | 1271 |
|
10143 | 1272 |
self withWaitCursorDo:[ |
1273 |
testResult := TestResult new. |
|
1274 |
testCases := Set new. |
|
1275 |
aTestSuite |
|
1276 |
run: testResult |
|
1277 |
beforeEachDo:[:test :result | |
|
1278 |
self displayRunning: result test: test total: aTestSuite tests size |
|
1279 |
] |
|
1280 |
afterEachDo:[:test :result| |
|
1281 |
testCases add: test class name |
|
1282 |
]. |
|
9953 | 1283 |
|
10143 | 1284 |
testCases do: [:clsName| |
1285 |
| cls | |
|
1286 |
||
1287 |
(cls := Smalltalk classNamed:clsName) notNil ifTrue:[ |
|
1288 |
cls rememberFailedTestRunWithResult:testResult |
|
1289 |
] |
|
1290 |
]. |
|
1291 |
self displayResult: testResult keepFailures: keepFailures keepErrors: keepErrors. |
|
1292 |
]. |
|
9953 | 1293 |
^testResult |
1294 |
||
1295 |
"Modified: / 18-01-2008 / 18:38:08 / janfrog" |
|
1296 |
"Created: / 06-06-2008 / 09:11:57 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1297 |
"Modified: / 06-06-2008 / 19:40:53 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1298 |
"Modified: / 19-03-2010 / 08:44:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10143 | 1299 |
"Modified: / 04-07-2011 / 23:06:23 / cg" |
9953 | 1300 |
! ! |
1301 |
||
1302 |
!TestRunner2 methodsFor:'actions - menu'! |
|
1303 |
||
9958 | 1304 |
classListMenuBrowse |
1305 |
UserPreferences current systemBrowserClass |
|
1306 |
browseClasses: (self selectedTestSuite tests collect:[:each | each class]) asSet |
|
1307 |
||
1308 |
"Created: / 30-06-2011 / 22:02:26 / cg" |
|
1309 |
! |
|
1310 |
||
10143 | 1311 |
openDocumentation |
1312 |
"opens the documentation file" |
|
1313 |
||
1314 |
HTMLDocumentView openFullOnDocumentationFile: 'tools/misc/TOP.html#SUNIT' |
|
1315 |
||
1316 |
"Created: / 04-07-2011 / 22:02:09 / cg" |
|
1317 |
! |
|
1318 |
||
9953 | 1319 |
packageListMenuSelectDependents |
1320 |
||
1321 |
|prjDef| |
|
1322 |
||
1323 |
prjDef := self theSingleSelectedProjectDefinition. |
|
1324 |
prjDef ifNil:[^self]. |
|
1325 |
self selectedPackages: |
|
1326 |
(prjDef dependentProjects copy add: prjDef package; yourself) |
|
1327 |
||
1328 |
"Created: / 06-06-2008 / 20:12:02 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1329 |
! |
|
1330 |
||
1331 |
packageListMenuSelectDependentsAll |
|
1332 |
||
1333 |
|prjDef| |
|
1334 |
||
1335 |
prjDef := self theSingleSelectedProjectDefinition. |
|
1336 |
prjDef ifNil:[^self]. |
|
1337 |
self selectedPackages: |
|
1338 |
(prjDef allDependentProjects copy add: prjDef package; yourself) |
|
1339 |
||
1340 |
"Created: / 06-06-2008 / 20:12:11 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1341 |
! |
|
1342 |
||
1343 |
packageListMenuSelectPrerequisites |
|
1344 |
||
1345 |
|prjDef| |
|
1346 |
||
1347 |
prjDef := self theSingleSelectedProjectDefinition. |
|
1348 |
prjDef ifNil:[^self]. |
|
1349 |
self selectedPackages: |
|
1350 |
(prjDef preRequisites copy add: prjDef package; yourself) |
|
1351 |
||
1352 |
"Created: / 06-06-2008 / 20:06:47 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1353 |
! |
|
1354 |
||
1355 |
packageListMenuSelectPrerequisitesAll |
|
1356 |
||
1357 |
|prjDef| |
|
1358 |
||
1359 |
prjDef := self theSingleSelectedProjectDefinition. |
|
1360 |
prjDef ifNil:[^self]. |
|
1361 |
self selectedPackages: |
|
1362 |
(prjDef allPreRequisites copy add: prjDef package; yourself) |
|
1363 |
||
1364 |
"Created: / 06-06-2008 / 20:11:22 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1365 |
! ! |
|
1366 |
||
1367 |
!TestRunner2 methodsFor:'aspects'! |
|
1368 |
||
1369 |
classCategoryOrPackageTabIndexHolder |
|
1370 |
||
1371 |
classCategoryOrPackageTabIndexHolder ifNil: |
|
1372 |
[classCategoryOrPackageTabIndexHolder := nil asValue. |
|
1373 |
classCategoryOrPackageTabIndexHolder onChangeEvaluate: |
|
1374 |
[classCategoryOrPackageTabIndexHolder value = 1 |
|
1375 |
ifTrue:[self classCategoryList selectionChanged]. |
|
1376 |
classCategoryOrPackageTabIndexHolder value = 2 |
|
1377 |
ifTrue:[self packageList selectionChanged]]]. |
|
1378 |
^classCategoryOrPackageTabIndexHolder |
|
1379 |
||
1380 |
"Created: / 05-06-2008 / 21:59:14 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1381 |
"Modified: / 06-06-2008 / 12:29:09 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1382 |
! |
|
1383 |
||
1384 |
classCategoryOrPackageTabList |
|
1385 |
"Generated by the TabListEditor" |
|
1386 |
||
1387 |
|list| |
|
1388 |
||
1389 |
(list := builder bindingAt:#classCategoryOrPackageTabList) isNil ifTrue:[ |
|
1390 |
builder aspectAt:#classCategoryOrPackageTabList put:(list := self class classCategoryOrPackageTabList). |
|
1391 |
]. |
|
1392 |
^ list |
|
1393 |
||
1394 |
"Created: / 05-06-2008 / 00:00:26 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1395 |
! |
|
1396 |
||
1397 |
classListInGeneratorHolder |
|
1398 |
classListInGeneratorHolder ifNil: |
|
1399 |
[ classListInGeneratorHolder := BlockValue with: |
|
1400 |
[:gen | |
|
1401 |
|testCases| |
|
1402 |
||
1403 |
testCases := OrderedCollection new:8. |
|
1404 |
gen do:[:cls | (self isTestCaseLike:cls) ifTrue:[ testCases add:cls ] ]. |
|
1405 |
testCases ] |
|
1406 |
argument:self classListOutGeneratorHolder ]. |
|
1407 |
^ classListInGeneratorHolder |
|
1408 |
||
1409 |
"Created: / 01-02-2010 / 09:50:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1410 |
! |
|
1411 |
||
1412 |
classListOutGeneratorHolder |
|
1413 |
||
1414 |
classListOutGeneratorHolder ifNil: |
|
1415 |
[classListOutGeneratorHolder := ValueHolder with:#()]. |
|
1416 |
^classListOutGeneratorHolder |
|
1417 |
||
1418 |
"Created: / 01-02-2010 / 09:46:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1419 |
! |
|
1420 |
||
1421 |
detailsHolder |
|
1422 |
"return/create the 'detailsHolder' value holder (automatically generated)" |
|
1423 |
||
1424 |
detailsHolder isNil ifTrue:[ |
|
1425 |
detailsHolder := ValueHolder new. |
|
1426 |
]. |
|
1427 |
^ detailsHolder |
|
1428 |
||
1429 |
"Created: / 18-01-2008 / 18:44:29 / janfrog" |
|
1430 |
! |
|
1431 |
||
1432 |
errorListHolder |
|
1433 |
"return/create the 'errorListHolder' value holder (automatically generated)" |
|
1434 |
||
1435 |
errorListHolder isNil ifTrue:[ |
|
1436 |
errorListHolder := ValueHolder new. |
|
1437 |
]. |
|
1438 |
^ errorListHolder |
|
1439 |
||
1440 |
"Created: / 06-06-2008 / 08:55:43 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1441 |
! |
|
1442 |
||
1443 |
errorSelectionHolder |
|
1444 |
"return/create the 'errorSelectionHolder' value holder (automatically generated)" |
|
1445 |
||
1446 |
errorSelectionHolder isNil ifTrue:[ |
|
1447 |
errorSelectionHolder := ValueHolder new. |
|
1448 |
]. |
|
1449 |
^ errorSelectionHolder |
|
1450 |
||
1451 |
"Created: / 06-06-2008 / 08:55:43 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1452 |
! |
|
1453 |
||
1454 |
failureListHolder |
|
1455 |
"return/create the 'failureListHolder' value holder (automatically generated)" |
|
1456 |
||
1457 |
failureListHolder isNil ifTrue:[ |
|
1458 |
failureListHolder := ValueHolder new. |
|
1459 |
]. |
|
1460 |
^ failureListHolder |
|
1461 |
||
1462 |
"Created: / 06-06-2008 / 08:55:43 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1463 |
! |
|
1464 |
||
1465 |
failureSelectionHolder |
|
1466 |
"return/create the 'failureSelectionHolder' value holder (automatically generated)" |
|
1467 |
||
1468 |
failureSelectionHolder isNil ifTrue:[ |
|
1469 |
failureSelectionHolder := ValueHolder new. |
|
1470 |
]. |
|
1471 |
^ failureSelectionHolder |
|
1472 |
||
1473 |
"Created: / 06-06-2008 / 08:55:43 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1474 |
! |
|
1475 |
||
1476 |
hasErrorsAspect |
|
1477 |
||
1478 |
^(AspectAdaptor forAspect:#notEmpty) |
|
1479 |
subjectChannel: self errorListHolder |
|
1480 |
||
1481 |
"Created: / 06-06-2008 / 09:17:04 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1482 |
! |
|
1483 |
||
1484 |
hasFailuresAspect |
|
1485 |
||
1486 |
^(AspectAdaptor forAspect:#notEmpty) |
|
1487 |
subjectChannel: self failureListHolder |
|
1488 |
||
1489 |
"Created: / 06-06-2008 / 09:17:14 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1490 |
! |
|
1491 |
||
1492 |
hasTestCasesAspect |
|
1493 |
||
1494 |
^(AspectAdaptor forAspect:#notEmpty) |
|
1495 |
subjectChannel: self classListInGeneratorHolder |
|
1496 |
||
1497 |
"Created: / 06-06-2008 / 09:54:09 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1498 |
"Modified: / 01-02-2010 / 09:53:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1499 |
! |
|
1500 |
||
1501 |
historyHolder |
|
1502 |
"return/create the 'resultHolder' value holder (automatically generated)" |
|
1503 |
||
1504 |
History ifNil:[self class initializeHistory]. |
|
1505 |
^History |
|
1506 |
||
1507 |
"Created: / 19-03-2010 / 08:43:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1508 |
! |
|
1509 |
||
1510 |
modeHolder |
|
1511 |
"return/create the 'modeHolder' value holder (automatically generated)" |
|
1512 |
||
1513 |
modeHolder isNil ifTrue:[ |
|
1514 |
modeHolder := ValueHolder new. |
|
1515 |
]. |
|
1516 |
^ modeHolder |
|
1517 |
||
1518 |
"Created: / 18-01-2008 / 18:44:29 / janfrog" |
|
1519 |
! |
|
1520 |
||
1521 |
resultAndHistoryTabList |
|
1522 |
"Generated by the TabListEditor" |
|
1523 |
||
1524 |
|list| |
|
1525 |
||
1526 |
(list := builder bindingAt:#resultAndHistoryTabList) isNil ifTrue:[ |
|
1527 |
builder aspectAt:#resultAndHistoryTabList put:(list := self class resultAndHistoryTabList). |
|
1528 |
]. |
|
1529 |
^ list |
|
1530 |
! |
|
1531 |
||
1532 |
resultHolder |
|
1533 |
"return/create the 'resultHolder' value holder (automatically generated)" |
|
1534 |
||
1535 |
resultHolder isNil ifTrue:[ |
|
1536 |
resultHolder := ValueHolder new. |
|
1537 |
]. |
|
1538 |
^ resultHolder |
|
1539 |
! ! |
|
1540 |
||
1541 |
!TestRunner2 methodsFor:'displaying'! |
|
1542 |
||
1543 |
displayColor: aColorValue |
|
1544 |
||
1545 |
(builder componentAt: #Mode) widget insideColor: aColorValue. |
|
1546 |
(builder componentAt: #Details) widget insideColor: aColorValue. |
|
1547 |
||
1548 |
"Modified: / 02-04-2000 / 14:21:42 / Sames" |
|
1549 |
"Created: / 18-01-2008 / 20:22:39 / janfrog" |
|
1550 |
! |
|
1551 |
||
1552 |
displayDetails: details |
|
1553 |
||
1554 |
self detailsHolder value: details |
|
1555 |
||
1556 |
"Modified: / 02-04-2000 / 14:21:42 / Sames" |
|
1557 |
"Created: / 18-01-2008 / 20:33:51 / janfrog" |
|
1558 |
! |
|
1559 |
||
1560 |
displayFail:result |
|
1561 |
self displayColor:self errorColor. |
|
1562 |
self displayMode:'Fail'. |
|
1563 |
self displayDetails:result printString. |
|
1564 |
||
1565 |
"Created: / 06-06-2008 / 08:49:25 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1566 |
"Modified: / 07-02-2010 / 14:43:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1567 |
! |
|
1568 |
||
1569 |
displayMode: mode |
|
1570 |
||
1571 |
self modeHolder value: mode |
|
1572 |
||
1573 |
"Modified: / 02-04-2000 / 14:21:42 / Sames" |
|
1574 |
"Created: / 18-01-2008 / 20:33:35 / janfrog" |
|
1575 |
! |
|
1576 |
||
1577 |
displayPass:result |
|
1578 |
self displayColor:self passedColor. |
|
1579 |
self displayMode:'Pass '. |
|
1580 |
self |
|
1581 |
displayDetails:result printString , ' ' , (self timeSinceLastPassAsString) |
|
1582 |
! |
|
1583 |
||
1584 |
displayResult: aTestResult |
|
1585 |
||
1586 |
self displayResult: aTestResult keepFailures: false keepErrors: false. |
|
1587 |
||
1588 |
"Modified: / 21-06-2000 / 12:14:52 / Sames" |
|
1589 |
"Created: / 06-06-2008 / 08:49:19 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1590 |
"Modified: / 06-06-2008 / 19:24:47 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1591 |
! |
|
1592 |
||
1593 |
displayResult: aTestResult keepFailures: keepFailures keepErrors: keepErrors |
|
1594 |
||
1595 |
||
1596 |
self resultHolder value: (Array with: aTestResult). |
|
1597 |
||
1598 |
aTestResult hasPassed |
|
1599 |
ifTrue:[self displayPass: aTestResult] |
|
1600 |
ifFalse:[self displayFail: aTestResult]. |
|
1601 |
keepFailures ifFalse: |
|
1602 |
[failureListHolder value: (aTestResult failures |
|
1603 |
asSortedCollection:[:a :b|a printString < b printString])]. |
|
1604 |
keepErrors ifFalse: |
|
1605 |
[errorListHolder value: (aTestResult errors |
|
1606 |
asSortedCollection:[:a :b|a printString < b printString])]. |
|
1607 |
self repairDamage |
|
1608 |
||
1609 |
"Modified: / 21-06-2000 / 12:14:52 / Sames" |
|
1610 |
"Created: / 06-06-2008 / 09:12:49 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1611 |
"Modified: / 19-03-2010 / 08:33:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1612 |
! |
|
1613 |
||
1614 |
displayRunning: result test: test total: total |
|
1615 |
||
10166
aa9d3a671526
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10143
diff
changeset
|
1616 |
self displayColor: (result hasPassed ifTrue:[self class currentlyRunningColor] ifFalse:[Color orange]). |
9953 | 1617 |
self displayMode: 'Running ' , test printString. |
1618 |
self displayDetails: total printString , ' total, ' , result printString |
|
1619 |
||
1620 |
"Modified: / 21-06-2000 / 12:14:52 / Sames" |
|
1621 |
"Created: / 06-06-2008 / 19:38:48 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
10166
aa9d3a671526
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10143
diff
changeset
|
1622 |
"Modified: / 05-07-2011 / 14:14:42 / cg" |
9953 | 1623 |
! ! |
1624 |
||
10143 | 1625 |
!TestRunner2 methodsFor:'events'! |
1626 |
||
1627 |
classSelectionChanged |
|
1628 |
(self selectedTestCases |
|
10519 | 1629 |
conform:[:eachClass | eachClass asTestCase coveredClasses notEmpty]) ifTrue:[ |
10143 | 1630 |
(builder componentAt:#RunCoverage) enable |
1631 |
] ifFalse:[ |
|
1632 |
(builder componentAt:#RunCoverage) disable |
|
1633 |
]. |
|
1634 |
||
1635 |
"Created: / 04-07-2011 / 22:59:42 / cg" |
|
10519 | 1636 |
"Modified: / 05-08-2011 / 19:44:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10143 | 1637 |
! ! |
1638 |
||
9953 | 1639 |
!TestRunner2 methodsFor:'hooks'! |
1640 |
||
1641 |
commonPostOpen |
|
1642 |
||
1643 |
self |
|
1644 |
displayMode:'SUnit Test Runner Tool'; |
|
1645 |
displayDetails:'Select tests and press ''Run Selected'''. |
|
1646 |
||
1647 |
self classCategoryOrPackageTabIndexHolder value:2 |
|
1648 |
||
1649 |
"Created: / 05-06-2008 / 21:58:09 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1650 |
"Modified: / 08-06-2008 / 10:06:57 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1651 |
"Modified: / 30-06-2011 / 20:20:40 / cg" |
|
1652 |
! ! |
|
1653 |
||
1654 |
!TestRunner2 methodsFor:'private'! |
|
1655 |
||
1656 |
buildSuiteFromClass: testCaseCls |
|
1657 |
"Bit hackish, but no time to redesign sUnit from |
|
1658 |
scratch" |
|
1659 |
||
1660 |
^ testCaseCls buildSuite. |
|
1661 |
||
1662 |
"Modified: / 01-03-2011 / 22:53:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1663 |
"Modified: / 30-05-2011 / 21:03:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1664 |
! |
|
1665 |
||
1666 |
formatTime: aTime |
|
1667 |
aTime hours > 0 ifTrue: [^aTime hours printString , 'h']. |
|
1668 |
aTime minutes > 0 ifTrue: [^aTime minutes printString , 'min']. |
|
1669 |
^aTime seconds printString , ' sec' |
|
1670 |
||
1671 |
"Created: / 18-01-2008 / 18:57:08 / janfrog" |
|
1672 |
! |
|
1673 |
||
1674 |
isTestCaseLike:cls |
|
1675 |
||
1676 |
^cls isTestCaseLike |
|
1677 |
||
1678 |
"Modified: / 28-02-2011 / 21:31:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1679 |
! |
|
1680 |
||
1681 |
repairDamage |
|
1682 |
|wg| |
|
1683 |
||
1684 |
(wg := self windowGroup) notNil ifTrue:[wg repairDamage]. |
|
1685 |
||
1686 |
"Created: / 18-01-2008 / 18:45:39 / janfrog" |
|
1687 |
! |
|
1688 |
||
1689 |
timeSinceLastPassAsString |
|
1690 |
lastPass isNil ifTrue: [^'']. |
|
1691 |
^', ' , (self formatTime: (Time now subtractTime: lastPass getSeconds)) , ' since last Pass' |
|
1692 |
||
1693 |
"Modified: / 03-04-2000 / 19:17:11 / Sames" |
|
1694 |
"Created: / 18-01-2008 / 18:51:21 / janfrog" |
|
1695 |
! ! |
|
1696 |
||
1697 |
!TestRunner2::ClassList class methodsFor:'documentation'! |
|
1698 |
||
1699 |
version |
|
10519 | 1700 |
^'$Id: Tools__TestRunner2.st,v 1.18 2011-08-05 18:45:33 vrany Exp $' |
9953 | 1701 |
! ! |
1702 |
||
1703 |
!TestRunner2::ClassList methodsFor:'private'! |
|
1704 |
||
1705 |
nameListEntryFor:aClass withNameSpace:useFullName |
|
1706 |
||
1707 |
| nm | |
|
1708 |
nm := super nameListEntryFor:aClass withNameSpace:useFullName. |
|
1709 |
(aClass isTestCaseLike) ifFalse: |
|
1710 |
[self breakPoint: #jv. |
|
1711 |
^nm]. |
|
1712 |
aClass isAbstract ifTrue:[nm := nm colorizeAllWith:Color gray]. |
|
1713 |
^nm |
|
1714 |
||
1715 |
"Created: / 27-11-2008 / 17:24:18 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1716 |
"Modified: / 28-02-2011 / 21:42:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1717 |
! ! |
|
1718 |
||
1719 |
!TestRunner2::ResultList class methodsFor:'interface specs'! |
|
1720 |
||
1721 |
windowSpec |
|
1722 |
"This resource specification was automatically generated |
|
1723 |
by the UIPainter of ST/X." |
|
1724 |
||
1725 |
"Do not manually edit this!! If it is corrupted, |
|
1726 |
the UIPainter may not be able to read the specification." |
|
1727 |
||
1728 |
" |
|
1729 |
UIPainter new openOnClass:Tools::TestRunner2::ResultList andSelector:#windowSpec |
|
1730 |
Tools::TestRunner2::ResultList new openInterface:#windowSpec |
|
1731 |
Tools::TestRunner2::ResultList open |
|
1732 |
" |
|
1733 |
||
1734 |
<resource: #canvas> |
|
1735 |
||
1736 |
^ |
|
1737 |
#(FullSpec |
|
1738 |
name: windowSpec |
|
1739 |
window: |
|
1740 |
(WindowSpec |
|
1741 |
label: 'Test Result List' |
|
1742 |
name: 'Test Result List' |
|
1743 |
min: (Point 10 10) |
|
1744 |
bounds: (Rectangle 0 0 300 300) |
|
1745 |
) |
|
1746 |
component: |
|
1747 |
(SpecCollection |
|
1748 |
collection: ( |
|
1749 |
(HierarchicalListViewSpec |
|
1750 |
name: 'List' |
|
1751 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
1752 |
model: selectionHolder |
|
1753 |
hasHorizontalScrollBar: true |
|
1754 |
hasVerticalScrollBar: true |
|
1755 |
listModel: listHolder |
|
1756 |
useIndex: false |
|
1757 |
highlightMode: line |
|
1758 |
doubleClickSelector: debugTest: |
|
1759 |
showLines: false |
|
1760 |
useDefaultIcons: false |
|
1761 |
) |
|
1762 |
) |
|
1763 |
||
1764 |
) |
|
1765 |
) |
|
1766 |
||
1767 |
"Modified: / 08-02-2010 / 10:08:09 / Jan Vrany <jan,vrany@fit.cvut.cz>" |
|
1768 |
! ! |
|
1769 |
||
1770 |
!TestRunner2::ResultList class methodsFor:'plugIn spec'! |
|
1771 |
||
1772 |
aspectSelectors |
|
1773 |
"This resource specification was automatically generated |
|
1774 |
by the UIPainter of ST/X." |
|
1775 |
||
1776 |
"Do not manually edit this. If it is corrupted, |
|
1777 |
the UIPainter may not be able to read the specification." |
|
1778 |
||
1779 |
"Return a description of exported aspects; |
|
1780 |
these can be connected to aspects of an embedding application |
|
1781 |
(if this app is embedded in a subCanvas)." |
|
1782 |
||
1783 |
^ #( |
|
1784 |
#resultsHolder |
|
1785 |
#selectionHolder |
|
1786 |
). |
|
1787 |
||
1788 |
"Modified: / 19-03-2010 / 08:32:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1789 |
! ! |
|
1790 |
||
1791 |
!TestRunner2::ResultList methodsFor:'actions'! |
|
1792 |
||
1793 |
debugTest:entryIndex |
|
1794 |
|entry test caughtEx| |
|
1795 |
||
1796 |
test := (entry := listHolder value at:entryIndex) test. |
|
1797 |
test ifNil:[ ^ self ]. |
|
1798 |
||
1799 |
[ |
|
1800 |
caughtEx := nil. |
|
1801 |
[test debug] on:GenericException do:[:ex | caughtEx := ex. ex pass]. |
|
1802 |
caughtEx |
|
1803 |
ifNil: |
|
1804 |
[self setResult: #passed in: entry] |
|
1805 |
ifNotNil: |
|
1806 |
[((caughtEx isKindOf:TestResult resumableFailure) |
|
1807 |
or:[ caughtEx isKindOf:TestResult failure ]) |
|
1808 |
ifTrue: |
|
1809 |
[self setResult: #failed in: entry] |
|
1810 |
ifFalse: |
|
1811 |
[self setResult: #error in: entry]]. |
|
1812 |
] fork |
|
1813 |
||
1814 |
"Modified: / 07-02-2010 / 18:59:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1815 |
"Created: / 08-02-2010 / 10:08:30 / Jan Vrany <jan,vrany@fit.cvut.cz>" |
|
1816 |
! ! |
|
1817 |
||
1818 |
!TestRunner2::ResultList methodsFor:'aspects'! |
|
1819 |
||
1820 |
listHolder |
|
1821 |
"return/create the 'listHolder' value holder (automatically generated)" |
|
1822 |
||
1823 |
listHolder isNil ifTrue:[ |
|
1824 |
listHolder := ValueHolder new. |
|
1825 |
]. |
|
1826 |
^ listHolder |
|
1827 |
! |
|
1828 |
||
1829 |
resultsHolder |
|
1830 |
"return/create the 'resultHolder' value holder (automatically generated)" |
|
1831 |
||
1832 |
resultsHolder isNil ifTrue:[ |
|
1833 |
resultsHolder := ValueHolder new. |
|
1834 |
resultsHolder addDependent:self. |
|
1835 |
]. |
|
1836 |
^ resultsHolder |
|
1837 |
||
1838 |
"Created: / 19-03-2010 / 08:31:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1839 |
! |
|
1840 |
||
1841 |
resultsHolder:aValueModel |
|
1842 |
"set the 'resultHolder' value holder (automatically generated)" |
|
1843 |
||
1844 |
|oldValue newValue| |
|
1845 |
||
1846 |
resultsHolder notNil ifTrue:[ |
|
1847 |
oldValue := resultsHolder value. |
|
1848 |
resultsHolder removeDependent:self. |
|
1849 |
]. |
|
1850 |
resultsHolder := aValueModel. |
|
1851 |
resultsHolder notNil ifTrue:[ |
|
1852 |
resultsHolder addDependent:self. |
|
1853 |
]. |
|
1854 |
newValue := resultsHolder value. |
|
1855 |
oldValue ~~ newValue ifTrue:[ |
|
1856 |
self update:#value with:newValue from:resultsHolder. |
|
1857 |
]. |
|
1858 |
||
1859 |
"Created: / 19-03-2010 / 08:32:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1860 |
! |
|
1861 |
||
1862 |
selectiomHolder |
|
1863 |
"return/create the 'selectiomHolder' value holder (automatically generated)" |
|
1864 |
||
1865 |
selectiomHolder isNil ifTrue:[ |
|
1866 |
selectiomHolder := ValueHolder new. |
|
1867 |
]. |
|
1868 |
^ selectiomHolder |
|
1869 |
! |
|
1870 |
||
1871 |
selectiomHolder:something |
|
1872 |
"set the 'selectiomHolder' value holder (automatically generated)" |
|
1873 |
||
1874 |
selectiomHolder := something. |
|
1875 |
! ! |
|
1876 |
||
1877 |
!TestRunner2::ResultList methodsFor:'change & update'! |
|
1878 |
||
1879 |
update:aspect with:param from:sender |
|
1880 |
||
1881 |
sender == resultsHolder ifTrue: |
|
1882 |
[results := self resultsHolder value. |
|
1883 |
self updateTimestampFormat. |
|
1884 |
self updateList. |
|
1885 |
^self]. |
|
1886 |
||
1887 |
super update:aspect with:param from:sender |
|
1888 |
||
1889 |
"Modified: / 19-03-2010 / 08:50:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1890 |
! |
|
1891 |
||
1892 |
updateList |
|
1893 |
||
1894 |
| list | |
|
1895 |
list := HierarchicalList new. |
|
1896 |
list root: self makeRootEntry. |
|
1897 |
list showRoot: false. |
|
1898 |
self listHolder value: list. |
|
1899 |
||
1900 |
"Created: / 07-02-2010 / 11:03:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1901 |
"Modified: / 07-02-2010 / 13:41:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1902 |
! |
|
1903 |
||
1904 |
updateTimestampFormat |
|
1905 |
||
10452
a2ce7970a068
changed: #selectedTestCases
Claus Gittinger <cg@exept.de>
parents:
10273
diff
changeset
|
1906 |
(results isEmptyOrNil or:[results size = 1]) |
9953 | 1907 |
ifTrue:[timestampFormat := nil]. |
1908 |
||
1909 |
((results collect:[:each|each timestamp]) asSet size = 1) |
|
1910 |
ifTrue: [timestampFormat := ' (%h:%m)'] |
|
1911 |
ifFalse:[timestampFormat := ' (%(month)-%(day) %h:%m)'] |
|
1912 |
||
1913 |
"Created: / 19-03-2010 / 08:50:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1914 |
"Modified: / 12-09-2010 / 09:50:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10452
a2ce7970a068
changed: #selectedTestCases
Claus Gittinger <cg@exept.de>
parents:
10273
diff
changeset
|
1915 |
"Modified: / 04-08-2011 / 19:05:57 / cg" |
9953 | 1916 |
! ! |
1917 |
||
1918 |
!TestRunner2::ResultList methodsFor:'private'! |
|
1919 |
||
1920 |
invalidate |
|
1921 |
||
1922 |
^(self componentAt: #List) scrolledView redraw |
|
1923 |
||
1924 |
"Created: / 07-02-2010 / 18:57:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1925 |
! |
|
1926 |
||
1927 |
setResult: testResult in: entry |
|
1928 |
||
1929 |
entry result ~= testResult ifTrue: |
|
1930 |
[entry result: testResult. |
|
1931 |
self invalidate]. |
|
1932 |
||
1933 |
"Created: / 08-02-2010 / 10:28:53 / Jan Vrany <jan,vrany@fit.cvut.cz>" |
|
1934 |
! ! |
|
1935 |
||
1936 |
!TestRunner2::ResultList methodsFor:'private-list'! |
|
1937 |
||
1938 |
makeClassEntryFor: class result: result tests: tests |
|
1939 |
||
1940 |
| entry children | |
|
1941 |
entry := ListEntry labeled: class name. |
|
1942 |
children := (tests asSortedCollection: [:a :b|a selector < b selector]) |
|
1943 |
collect:[:test|self makeTestEntryFor: test result: result]. |
|
1944 |
entry setChildren: children. |
|
1945 |
(entry result ~= #passed and:[results size = 1]) ifTrue:[entry expand]. |
|
1946 |
^entry |
|
1947 |
||
1948 |
"Created: / 19-03-2010 / 08:41:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1949 |
! |
|
1950 |
||
1951 |
makeResultEntryFor: result |
|
1952 |
||
1953 |
| entry children classes label | |
|
10452
a2ce7970a068
changed: #selectedTestCases
Claus Gittinger <cg@exept.de>
parents:
10273
diff
changeset
|
1954 |
label := result name ? ''. |
9953 | 1955 |
result timestamp ifNotNil: |
1956 |
[label := label , (result timestamp printStringFormat: timestampFormat)]. |
|
1957 |
entry := ListEntry labeled: label. |
|
1958 |
classes := Dictionary new. |
|
1959 |
result tests do: |
|
1960 |
[:test| |
|
1961 |
(classes at: test class ifAbsentPut:[OrderedCollection new:1]) |
|
1962 |
add: test]. |
|
1963 |
children := classes keysAndValuesCollect: |
|
1964 |
[:class :tests| |
|
1965 |
self makeClassEntryFor: class result: result tests: tests]. |
|
1966 |
entry setChildren: children. |
|
1967 |
^entry. |
|
1968 |
||
1969 |
"Created: / 19-03-2010 / 08:36:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10452
a2ce7970a068
changed: #selectedTestCases
Claus Gittinger <cg@exept.de>
parents:
10273
diff
changeset
|
1970 |
"Modified: / 04-08-2011 / 20:30:39 / cg" |
9953 | 1971 |
! |
1972 |
||
1973 |
makeRootEntry |
|
1974 |
||
1975 |
| entry children | |
|
1976 |
entry := ListEntry labeled: 'Test Results'. |
|
10452
a2ce7970a068
changed: #selectedTestCases
Claus Gittinger <cg@exept.de>
parents:
10273
diff
changeset
|
1977 |
results isEmptyOrNil ifTrue:[^entry]. |
9953 | 1978 |
children := results size = 1 |
1979 |
ifTrue: |
|
1980 |
[(self makeResultEntryFor: results anyOne) getChildren] |
|
1981 |
ifFalse: |
|
1982 |
[results collect:[:result|self makeResultEntryFor:result]]. |
|
1983 |
entry setChildren: children. |
|
1984 |
^entry. |
|
1985 |
||
1986 |
"Created: / 07-02-2010 / 13:39:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1987 |
"Modified: / 19-03-2010 / 08:39:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10452
a2ce7970a068
changed: #selectedTestCases
Claus Gittinger <cg@exept.de>
parents:
10273
diff
changeset
|
1988 |
"Modified: / 04-08-2011 / 19:05:55 / cg" |
9953 | 1989 |
! |
1990 |
||
1991 |
makeTestEntryFor: test result: result |
|
1992 |
||
1993 |
| entry | |
|
1994 |
entry := ListEntry labeled: test selector. |
|
1995 |
entry test: test. |
|
1996 |
(result errors includes: test) |
|
1997 |
ifTrue: |
|
1998 |
[entry result: #error] |
|
1999 |
ifFalse: |
|
2000 |
[(result failures includes: test) |
|
2001 |
ifTrue: |
|
2002 |
[entry result: #failed] |
|
2003 |
ifFalse: |
|
2004 |
[entry result: #passed]]. |
|
2005 |
^entry |
|
2006 |
||
2007 |
"Created: / 19-03-2010 / 08:41:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2008 |
! ! |
|
2009 |
||
2010 |
!TestRunner2::ResultList::ListEntry class methodsFor:'initialization'! |
|
2011 |
||
2012 |
initialize |
|
2013 |
"Invoked at system start or when the class is dynamically loaded." |
|
2014 |
||
2015 |
"/ please change as required (and remove this comment) |
|
2016 |
||
2017 |
PassedText := ' [passed]' asText colorizeAllWith: Tools::TestRunner2 passedColor darker. |
|
2018 |
FailedText := ' [failed]' asText colorizeAllWith: Tools::TestRunner2 failedColor darker. |
|
2019 |
ErrorText := ' [error]' asText colorizeAllWith: Tools::TestRunner2 errorColor darker. |
|
2020 |
||
2021 |
"Modified: / 07-02-2010 / 15:06:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2022 |
! ! |
|
2023 |
||
2024 |
!TestRunner2::ResultList::ListEntry class methodsFor:'instance creation'! |
|
2025 |
||
2026 |
labeled: aStringOrText |
|
2027 |
||
2028 |
^self new label: aStringOrText |
|
2029 |
||
2030 |
"Created: / 07-02-2010 / 13:31:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2031 |
! ! |
|
2032 |
||
2033 |
!TestRunner2::ResultList::ListEntry methodsFor:'accessing'! |
|
2034 |
||
2035 |
icon |
|
2036 |
||
2037 |
^self result == #passed |
|
2038 |
ifTrue:[SystemBrowser greenThumbUpSmallIcon] |
|
2039 |
ifFalse:[SystemBrowser redThumbDownSmallIcon] |
|
2040 |
||
2041 |
"Created: / 07-02-2010 / 18:34:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2042 |
! |
|
2043 |
||
2044 |
label |
|
2045 |
||
2046 |
| result | |
|
2047 |
result := self result. |
|
2048 |
realLabel ifNil: |
|
2049 |
[realLabel := label. |
|
2050 |
test ifNotNil:[ |
|
2051 |
result == #passed ifTrue:[realLabel := realLabel , PassedText]. |
|
2052 |
result == #error ifTrue:[realLabel := realLabel , ErrorText]. |
|
2053 |
result == #failed ifTrue:[realLabel := realLabel , FailedText]. |
|
2054 |
] ifNil: [ |
|
2055 |
realLabel := realLabel , self summary. |
|
2056 |
] |
|
2057 |
]. |
|
2058 |
||
2059 |
^ realLabel |
|
2060 |
||
2061 |
"Modified: / 07-02-2010 / 18:28:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2062 |
"Modified: / 08-02-2010 / 10:15:35 / Jan Vrany <jan,vrany@fit.cvut.cz>" |
|
2063 |
! |
|
2064 |
||
2065 |
label:aText |
|
2066 |
label := aText. |
|
2067 |
realLabel := nil. |
|
2068 |
||
2069 |
"Modified: / 07-02-2010 / 14:36:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2070 |
! |
|
2071 |
||
2072 |
result |
|
2073 |
||
2074 |
result ifNil: |
|
2075 |
[result := self computeResult]. |
|
2076 |
^ result |
|
2077 |
||
2078 |
"Modified: / 07-02-2010 / 18:30:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2079 |
! |
|
2080 |
||
2081 |
result:aSymbol |
|
2082 |
||
2083 |
result := aSymbol. |
|
2084 |
self reset. |
|
2085 |
result := aSymbol. |
|
2086 |
||
2087 |
"Modified: / 07-02-2010 / 18:55:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2088 |
! |
|
2089 |
||
2090 |
test |
|
2091 |
^ test |
|
2092 |
! |
|
2093 |
||
2094 |
test:aTestCase |
|
2095 |
test := aTestCase. |
|
2096 |
! ! |
|
2097 |
||
2098 |
!TestRunner2::ResultList::ListEntry methodsFor:'enumeration'! |
|
2099 |
||
2100 |
leafsDo: aBlock |
|
2101 |
||
2102 |
self isLeafEntry ifTrue:[^aBlock value: self]. |
|
2103 |
children do:[:each|each leafsDo: aBlock] |
|
2104 |
||
2105 |
"Created: / 08-02-2010 / 10:17:32 / Jan Vrany <jan,vrany@fit.cvut.cz>" |
|
2106 |
! |
|
2107 |
||
2108 |
testsDo: aBlock |
|
2109 |
||
2110 |
test ifNotNil:[aBlock value: test]. |
|
2111 |
children do:[:each|each testsDo: aBlock] |
|
2112 |
||
2113 |
"Created: / 08-02-2010 / 10:10:36 / Jan Vrany <jan,vrany@fit.cvut.cz>" |
|
2114 |
! ! |
|
2115 |
||
2116 |
!TestRunner2::ResultList::ListEntry methodsFor:'initialization'! |
|
2117 |
||
2118 |
reset |
|
2119 |
||
2120 |
realLabel := result := nil. |
|
2121 |
(parent notNil and:[parent class == self class]) |
|
2122 |
ifTrue:[parent reset] |
|
2123 |
||
2124 |
"Created: / 07-02-2010 / 18:44:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2125 |
! |
|
2126 |
||
2127 |
setChildren: aCollection |
|
2128 |
||
2129 |
children := aCollection. |
|
2130 |
children do:[:e|e parent: self]. |
|
2131 |
||
2132 |
"Created: / 07-02-2010 / 11:41:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2133 |
! ! |
|
2134 |
||
2135 |
!TestRunner2::ResultList::ListEntry methodsFor:'private'! |
|
2136 |
||
2137 |
computeResult |
|
2138 |
||
2139 |
| result | |
|
2140 |
result := #passed. |
|
2141 |
(children ? #()) do: |
|
2142 |
[:entry| |
|
2143 |
entry result == #error ifTrue:[^#error]. |
|
2144 |
entry result == #failed ifTrue:[result := #failed]]. |
|
2145 |
^result |
|
2146 |
||
2147 |
"Created: / 07-02-2010 / 18:30:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2148 |
! |
|
2149 |
||
2150 |
summary |
|
2151 |
||
2152 |
| passed failed error | |
|
2153 |
passed := failed := error := 0. |
|
2154 |
self leafsDo: |
|
2155 |
[:entry| |
|
2156 |
entry isPassed ifTrue:[passed := passed + 1]. |
|
2157 |
entry isFailed ifTrue:[failed := failed + 1]. |
|
2158 |
entry isError ifTrue:[error := error + 1]]. |
|
2159 |
||
2160 |
^' [ ' , passed printString , ' / ' , failed printString , ' / ', error printString , ' ]' |
|
2161 |
||
2162 |
"Created: / 08-02-2010 / 10:16:52 / Jan Vrany <jan,vrany@fit.cvut.cz>" |
|
2163 |
! ! |
|
2164 |
||
2165 |
!TestRunner2::ResultList::ListEntry methodsFor:'testing'! |
|
2166 |
||
2167 |
isError |
|
2168 |
||
2169 |
^self result == #error |
|
2170 |
||
2171 |
"Created: / 08-02-2010 / 10:18:26 / Jan Vrany <jan,vrany@fit.cvut.cz>" |
|
2172 |
! |
|
2173 |
||
2174 |
isFailed |
|
2175 |
||
2176 |
^self result == #failed |
|
2177 |
||
2178 |
"Created: / 08-02-2010 / 10:18:21 / Jan Vrany <jan,vrany@fit.cvut.cz>" |
|
2179 |
! |
|
2180 |
||
2181 |
isLeafEntry |
|
2182 |
||
10452
a2ce7970a068
changed: #selectedTestCases
Claus Gittinger <cg@exept.de>
parents:
10273
diff
changeset
|
2183 |
^children isEmptyOrNil |
9953 | 2184 |
|
2185 |
"Created: / 08-02-2010 / 10:11:06 / Jan Vrany <jan,vrany@fit.cvut.cz>" |
|
10452
a2ce7970a068
changed: #selectedTestCases
Claus Gittinger <cg@exept.de>
parents:
10273
diff
changeset
|
2186 |
"Modified: / 04-08-2011 / 19:05:59 / cg" |
9953 | 2187 |
! |
2188 |
||
2189 |
isPassed |
|
2190 |
||
2191 |
^self result == #passed |
|
2192 |
||
2193 |
"Created: / 08-02-2010 / 10:18:15 / Jan Vrany <jan,vrany@fit.cvut.cz>" |
|
2194 |
! ! |
|
2195 |
||
2196 |
!TestRunner2 class methodsFor:'documentation'! |
|
2197 |
||
10513 | 2198 |
version |
10519 | 2199 |
^ '$Header: /cvs/stx/stx/libtool/Tools__TestRunner2.st,v 1.18 2011-08-05 18:45:33 vrany Exp $' |
10513 | 2200 |
! |
2201 |
||
9953 | 2202 |
version_CVS |
10519 | 2203 |
^ '$Header: /cvs/stx/stx/libtool/Tools__TestRunner2.st,v 1.18 2011-08-05 18:45:33 vrany Exp $' |
9953 | 2204 |
! |
2205 |
||
2206 |
version_SVN |
|
2207 |
^ '§Id: Tools__TestRunner2.st 7486 2009-10-26 22:06:24Z vranyj1 §' |
|
2208 |
! ! |
|
2209 |
||
2210 |
TestRunner2 initialize! |