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