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