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