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