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