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