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