author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Sat, 01 Dec 2012 00:04:32 +0000 | |
branch | jv |
changeset 12309 | 1dceb2eb9139 |
parent 12308 | 5d9291c0fc27 |
child 12310 | bdd2106c15f5 |
permissions | -rw-r--r-- |
9954 | 1 |
" |
10092 | 2 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague |
3 |
Copyright (c) 2009-2010 eXept Software AG |
|
9954 | 4 |
|
10092 | 5 |
Permission is hereby granted, free of charge, to any person |
6 |
obtaining a copy of this software and associated documentation |
|
7 |
files (the 'Software'), to deal in the Software without |
|
8 |
restriction, including without limitation the rights to use, |
|
9 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
10 |
copies of the Software, and to permit persons to whom the |
|
11 |
Software is furnished to do so, subject to the following |
|
12 |
conditions: |
|
13 |
||
14 |
The above copyright notice and this permission notice shall be |
|
15 |
included in all copies or substantial portions of the Software. |
|
16 |
||
17 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
18 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
19 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
20 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
21 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
22 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
23 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
24 |
OTHER DEALINGS IN THE SOFTWARE. |
|
9954 | 25 |
" |
26 |
"{ Package: 'stx:libtool' }" |
|
27 |
||
28 |
"{ NameSpace: Tools }" |
|
29 |
||
12309
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
30 |
AbstractTestRunner subclass:#TestRunnerEmbedded |
12254 | 31 |
instanceVariableNames:'runnerPanel selectedClassesHolder selectedProtocolsHolder |
32 |
selectedMethodsHolder methodGeneratorHolder resultHolder |
|
33 |
resultInfoHolder resultBackgroundColorHolder runningHolder |
|
34 |
progressHolder progressIndicatorShownHolder infoHolder |
|
35 |
testProcess allTestCases' |
|
10647
1e9912f9a0d8
Embedded test runner no longer reuse old testcase instances
vrany
parents:
10608
diff
changeset
|
36 |
classVariableNames:'' |
1e9912f9a0d8
Embedded test runner no longer reuse old testcase instances
vrany
parents:
10608
diff
changeset
|
37 |
poolDictionaries:'' |
1e9912f9a0d8
Embedded test runner no longer reuse old testcase instances
vrany
parents:
10608
diff
changeset
|
38 |
category:'SUnit-UI' |
9954 | 39 |
! |
40 |
||
41 |
Object subclass:#SuiteAndResult |
|
10647
1e9912f9a0d8
Embedded test runner no longer reuse old testcase instances
vrany
parents:
10608
diff
changeset
|
42 |
instanceVariableNames:'suite result' |
1e9912f9a0d8
Embedded test runner no longer reuse old testcase instances
vrany
parents:
10608
diff
changeset
|
43 |
classVariableNames:'' |
1e9912f9a0d8
Embedded test runner no longer reuse old testcase instances
vrany
parents:
10608
diff
changeset
|
44 |
poolDictionaries:'' |
1e9912f9a0d8
Embedded test runner no longer reuse old testcase instances
vrany
parents:
10608
diff
changeset
|
45 |
privateIn:TestRunnerEmbedded |
9954 | 46 |
! |
47 |
||
48 |
!TestRunnerEmbedded class methodsFor:'documentation'! |
|
49 |
||
50 |
copyright |
|
51 |
" |
|
10092 | 52 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague |
53 |
Copyright (c) 2009-2010 eXept Software AG |
|
54 |
||
55 |
Permission is hereby granted, free of charge, to any person |
|
56 |
obtaining a copy of this software and associated documentation |
|
57 |
files (the 'Software'), to deal in the Software without |
|
58 |
restriction, including without limitation the rights to use, |
|
59 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
60 |
copies of the Software, and to permit persons to whom the |
|
61 |
Software is furnished to do so, subject to the following |
|
62 |
conditions: |
|
9954 | 63 |
|
10092 | 64 |
The above copyright notice and this permission notice shall be |
65 |
included in all copies or substantial portions of the Software. |
|
66 |
||
67 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
68 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
69 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
70 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
71 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
72 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
73 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
74 |
OTHER DEALINGS IN THE SOFTWARE. |
|
9954 | 75 |
" |
10175 | 76 |
! |
77 |
||
78 |
documentation |
|
79 |
" |
|
80 |
a tiny runner to be embedded in a system browser |
|
81 |
" |
|
9954 | 82 |
! ! |
83 |
||
12254 | 84 |
!TestRunnerEmbedded class methodsFor:'help specs'! |
85 |
||
86 |
flyByHelpSpec |
|
87 |
"This resource specification was automatically generated |
|
88 |
by the UIHelpTool of ST/X." |
|
89 |
||
90 |
"Do not manually edit this!! If it is corrupted, |
|
91 |
the UIHelpTool may not be able to read the specification." |
|
92 |
||
93 |
" |
|
94 |
UIHelpTool openOnClass:Tools::TestRunnerEmbedded |
|
95 |
" |
|
96 |
||
97 |
<resource: #help> |
|
98 |
||
99 |
^ super flyByHelpSpec addPairsFrom:#( |
|
100 |
||
101 |
#debugSelected |
|
102 |
'Run the selected test(s) with debugging enabled' |
|
103 |
||
104 |
#runAll |
|
105 |
'Run all tests' |
|
106 |
||
107 |
#runFailed |
|
108 |
'Only rerun failed tests' |
|
109 |
||
110 |
#runSelected |
|
111 |
'Run the selected test(s)' |
|
112 |
||
113 |
#stopRun |
|
114 |
'Stop the test-run' |
|
115 |
||
116 |
) |
|
117 |
||
118 |
"Created: / 04-06-2012 / 19:27:47 / cg" |
|
119 |
! ! |
|
120 |
||
9954 | 121 |
!TestRunnerEmbedded class methodsFor:'interface specs'! |
122 |
||
123 |
windowSpec |
|
124 |
"This resource specification was automatically generated |
|
125 |
by the UIPainter of ST/X." |
|
126 |
||
127 |
"Do not manually edit this!! If it is corrupted, |
|
128 |
the UIPainter may not be able to read the specification." |
|
129 |
||
130 |
" |
|
131 |
UIPainter new openOnClass:Tools::TestRunnerEmbedded andSelector:#windowSpec |
|
132 |
Tools::TestRunnerEmbedded new openInterface:#windowSpec |
|
133 |
Tools::TestRunnerEmbedded open |
|
134 |
" |
|
135 |
||
136 |
<resource: #canvas> |
|
137 |
||
138 |
^ |
|
139 |
#(FullSpec |
|
140 |
name: windowSpec |
|
141 |
window: |
|
142 |
(WindowSpec |
|
143 |
label: 'Test Runner Embedded' |
|
144 |
name: 'Test Runner Embedded' |
|
145 |
min: (Point 10 10) |
|
12254 | 146 |
bounds: (Rectangle 0 0 595 50) |
9954 | 147 |
) |
148 |
component: |
|
149 |
(SpecCollection |
|
150 |
collection: ( |
|
12254 | 151 |
(ViewSpec |
152 |
name: 'Runner' |
|
9954 | 153 |
layout: (LayoutFrame 5 0 0 0 -5 1 0 1) |
12254 | 154 |
backgroundChannel: resultBackgroundColorAspect |
9954 | 155 |
component: |
156 |
(SpecCollection |
|
157 |
collection: ( |
|
12254 | 158 |
(HorizontalPanelViewSpec |
159 |
name: 'RunnerInnerBox' |
|
160 |
layout: (LayoutFrame 5 0 0 0 -5 1 0 1) |
|
9954 | 161 |
backgroundChannel: resultBackgroundColorAspect |
12254 | 162 |
horizontalLayout: rightSpaceFit |
163 |
verticalLayout: center |
|
164 |
horizontalSpace: 0 |
|
165 |
elementsChangeSize: true |
|
9954 | 166 |
component: |
167 |
(SpecCollection |
|
168 |
collection: ( |
|
12254 | 169 |
(ViewSpec |
170 |
name: 'RunnerInfoBox' |
|
171 |
backgroundChannel: resultBackgroundColorAspect |
|
9954 | 172 |
component: |
173 |
(SpecCollection |
|
174 |
collection: ( |
|
12254 | 175 |
(LabelSpec |
176 |
label: 'Run tests first!!' |
|
177 |
name: 'ResultName' |
|
178 |
layout: (LayoutFrame 0 0 0 0 0 1 -10 1) |
|
179 |
backgroundChannel: resultBackgroundColorAspect |
|
180 |
foregroundColor: (Color 100.0 100.0 100.0) |
|
181 |
translateLabel: true |
|
182 |
labelChannel: resultNameAspect |
|
183 |
adjust: left |
|
184 |
) |
|
185 |
(LabelSpec |
|
186 |
name: 'ResultInfo' |
|
187 |
layout: (LayoutFrame 0 0 -10 1 0 1 0 1) |
|
188 |
style: (FontDescription helvetica medium roman 8 #'iso10646-1') |
|
189 |
backgroundChannel: resultBackgroundColorAspect |
|
190 |
foregroundColor: (Color 100.0 100.0 100.0) |
|
191 |
translateLabel: true |
|
192 |
labelChannel: resultInfoAspect |
|
193 |
adjust: left |
|
194 |
) |
|
9954 | 195 |
(ViewSpec |
12254 | 196 |
name: 'ProgressPanel' |
197 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
198 |
visibilityChannel: progressIndicatorShownHolder |
|
9954 | 199 |
backgroundChannel: resultBackgroundColorAspect |
200 |
component: |
|
201 |
(SpecCollection |
|
202 |
collection: ( |
|
12254 | 203 |
(ProgressIndicatorSpec |
204 |
name: 'RunningProgress' |
|
205 |
layout: (LayoutFrame 5 0 -10 0.5 -5 1 10 0.5) |
|
206 |
model: progressHolder |
|
9954 | 207 |
) |
208 |
) |
|
209 |
||
210 |
) |
|
211 |
) |
|
212 |
) |
|
213 |
||
214 |
) |
|
12254 | 215 |
extent: (Point 276 30) |
216 |
) |
|
217 |
(ActionButtonSpec |
|
12262 | 218 |
label: 'Debug' |
219 |
name: 'DebugButton' |
|
220 |
activeHelpKey: debugSelected |
|
221 |
translateLabel: true |
|
222 |
model: debug |
|
223 |
enableChannel: runEnabledHolder |
|
224 |
extent: (Point 60 25) |
|
225 |
) |
|
226 |
(ActionButtonSpec |
|
12254 | 227 |
label: 'Stop' |
228 |
name: 'Button2' |
|
229 |
activeHelpKey: stopRun |
|
230 |
visibilityChannel: runningHolder |
|
231 |
translateLabel: true |
|
232 |
model: stop |
|
233 |
extent: (Point 60 25) |
|
234 |
) |
|
235 |
(ActionButtonSpec |
|
236 |
label: 'Run' |
|
237 |
name: 'Run' |
|
238 |
activeHelpKey: runSelected |
|
239 |
visibilityChannel: notRunningHolder |
|
240 |
translateLabel: true |
|
241 |
model: run |
|
242 |
enableChannel: runEnabledHolder |
|
243 |
extent: (Point 60 25) |
|
244 |
) |
|
245 |
(ActionButtonSpec |
|
246 |
label: 'Run Failed' |
|
247 |
name: 'Button1' |
|
248 |
activeHelpKey: runFailed |
|
249 |
translateLabel: true |
|
250 |
model: runFailed |
|
251 |
enableChannel: runFailedEnabledHolder |
|
252 |
extent: (Point 60 25) |
|
253 |
) |
|
254 |
(ActionButtonSpec |
|
255 |
label: 'Run all' |
|
256 |
name: 'RunAll' |
|
257 |
activeHelpKey: runAll |
|
258 |
translateLabel: true |
|
259 |
model: runAll |
|
260 |
enableChannel: runAllEnabledHolder |
|
261 |
extent: (Point 60 25) |
|
9954 | 262 |
) |
263 |
) |
|
264 |
||
265 |
) |
|
12254 | 266 |
postBuildCallback: postBuildRunnerPanel: |
9954 | 267 |
) |
268 |
) |
|
269 |
||
270 |
) |
|
271 |
) |
|
272 |
) |
|
273 |
||
274 |
) |
|
275 |
) |
|
276 |
||
277 |
! ! |
|
278 |
||
279 |
!TestRunnerEmbedded class methodsFor:'plugIn spec'! |
|
280 |
||
281 |
aspectSelectors |
|
282 |
"This resource specification was automatically generated |
|
283 |
by the UIPainter of ST/X." |
|
284 |
||
285 |
"Do not manually edit this. If it is corrupted, |
|
286 |
the UIPainter may not be able to read the specification." |
|
287 |
||
288 |
"Return a description of exported aspects; |
|
289 |
these can be connected to aspects of an embedding application |
|
290 |
(if this app is embedded in a subCanvas)." |
|
291 |
||
292 |
^ #( |
|
293 |
#methodGeneratorHolder |
|
294 |
#selectedClassesHolder |
|
295 |
#selectedMethodsHolder |
|
296 |
#selectedProtocolsHolder |
|
297 |
). |
|
298 |
||
299 |
! ! |
|
300 |
||
301 |
!TestRunnerEmbedded methodsFor:'accessing'! |
|
302 |
||
12308 | 303 |
allTestCases |
304 |
allTestCases isNil ifTrue:[ |
|
305 |
self updateTestCases |
|
306 |
]. |
|
307 |
^ allTestCases |
|
308 |
! |
|
309 |
||
10175 | 310 |
infoHolder:something |
311 |
"to show something in the browsers info area (near the bottom" |
|
312 |
||
313 |
infoHolder := something. |
|
314 |
||
315 |
"Created: / 05-07-2011 / 16:22:24 / cg" |
|
316 |
! |
|
317 |
||
12308 | 318 |
invalidateAllTestCases |
319 |
allTestCases := nil |
|
9954 | 320 |
! |
321 |
||
12309
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
322 |
selectedTestMethods |
12308 | 323 |
|
12309
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
324 |
| selectedClass | |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
325 |
selectedClass := self theSingleTestCase. |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
326 |
|
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
327 |
^ (self selectedMethodsHolder value ? #()) select: |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
328 |
[:mthd | | cls | |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
329 |
(cls := selectedClass) isNil ifTrue:[cls := mthd mclass]. |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
330 |
(self isTestCaseLike:selectedClass) |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
331 |
and:[ selectedClass isTestSelector:mthd selector ] ] |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
332 |
|
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
333 |
"Created: / 15-03-2010 / 13:21:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
334 |
"Modified: / 22-07-2011 / 15:46:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
335 |
"Modified: / 02-08-2011 / 17:46:38 / cg" |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
336 |
! |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
337 |
|
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
338 |
selectedTestMethodsFromProtocols:protocols |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
339 |
|
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
340 |
|methods generator selectedClass| |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
341 |
|
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
342 |
methods := Set new. |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
343 |
generator := self methodGeneratorHolder value. |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
344 |
selectedClass := self theSingleTestCase. |
12308 | 345 |
|
12309
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
346 |
generator notNil ifTrue:[ |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
347 |
generator do: [:cls :cat :sel :mthd | |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
348 |
(mthd notNil |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
349 |
and:[ (self isTestCaseLike:(selectedClass ? cls)) |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
350 |
and:[ (selectedClass ? cls) isTestSelector:sel ] ]) |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
351 |
ifTrue:[ methods add:mthd ] |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
352 |
] |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
353 |
] ifFalse:[ |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
354 |
allTestCases do: [:cls | |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
355 |
cls methodsDo: [:mthd | |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
356 |
((protocols includes:mthd category) and:[ cls isTestSelector:mthd selector ]) |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
357 |
ifTrue:[ |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
358 |
methods add:mthd |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
359 |
] |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
360 |
] |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
361 |
] |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
362 |
]. |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
363 |
^ methods |
12308 | 364 |
|
12309
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
365 |
"Created: / 15-03-2010 / 19:50:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
366 |
"Modified: / 22-07-2011 / 15:53:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
367 |
"Modified (format): / 04-06-2012 / 19:05:32 / cg" |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
368 |
! |
10374 | 369 |
|
12308 | 370 |
selectedTestMethodsFromProtocols:protocols inClass:aTestClass |
371 |
||
372 |
|methods generator| |
|
9954 | 373 |
|
374 |
methods := Set new. |
|
375 |
generator := self methodGeneratorHolder value. |
|
10374 | 376 |
|
12254 | 377 |
generator notNil ifTrue:[ |
378 |
generator do: [:cls :cat :sel :mthd | |
|
379 |
(mthd notNil |
|
12308 | 380 |
and:[ (self isTestCaseLike:(aTestClass ? cls)) |
381 |
and:[ (aTestClass ? cls) isTestSelector:sel ] ]) |
|
12254 | 382 |
ifTrue:[ methods add:mthd ] |
383 |
] |
|
384 |
] ifFalse:[ |
|
12308 | 385 |
self allTestCases do: [:cls | |
12254 | 386 |
cls methodsDo: [:mthd | |
387 |
((protocols includes:mthd category) and:[ cls isTestSelector:mthd selector ]) |
|
388 |
ifTrue:[ |
|
389 |
methods add:mthd |
|
390 |
] |
|
391 |
] |
|
392 |
] |
|
393 |
]. |
|
9954 | 394 |
^ methods |
395 |
||
396 |
"Created: / 15-03-2010 / 19:50:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10374 | 397 |
"Modified: / 22-07-2011 / 15:53:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
12254 | 398 |
"Modified (format): / 04-06-2012 / 19:05:32 / cg" |
10374 | 399 |
! |
400 |
||
12308 | 401 |
selectedTestMethodsInClass:testClass |
402 |
^ (self selectedMethodsHolder value ? #()) select: |
|
403 |
[:mthd | | cls | |
|
404 |
(cls := testClass) isNil ifTrue:[cls := mthd mclass]. |
|
405 |
(self isTestCaseLike:testClass) |
|
406 |
and:[ testClass isTestSelector:mthd selector ] ] |
|
407 |
||
408 |
"Created: / 15-03-2010 / 13:21:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
409 |
"Modified: / 22-07-2011 / 15:46:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
410 |
"Modified: / 02-08-2011 / 17:46:38 / cg" |
|
411 |
! |
|
412 |
||
10374 | 413 |
theSingleTestCase |
414 |
||
12308 | 415 |
self allTestCases isEmptyOrNil ifTrue:[^nil]. |
12254 | 416 |
allTestCases size > 1 ifTrue:[^nil]. |
10374 | 417 |
|
12254 | 418 |
^allTestCases anyOne. |
10374 | 419 |
|
420 |
"Created: / 22-07-2011 / 15:44:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
9954 | 421 |
! ! |
422 |
||
423 |
!TestRunnerEmbedded methodsFor:'actions'! |
|
424 |
||
425 |
debug |
|
12308 | 426 |
| suiteAndResult suite result | |
9954 | 427 |
|
428 |
suiteAndResult := self resultHolder value. |
|
12125 | 429 |
suite := suiteAndResult suiteForRun. |
12254 | 430 |
"/ suite tests size ~= 1 ifTrue:[^self breakPoint: #jv]. |
431 |
"/ test := suiteAndResult suite tests anyOne. |
|
432 |
||
433 |
self stop. |
|
434 |
||
12308 | 435 |
"/ debug run is synchronous |
436 |
[ |
|
437 |
self runningHolder value:true. |
|
12254 | 438 |
|
12308 | 439 |
suite tests do:[:test | |
440 |
test debug. |
|
441 |
(test class testSelectorPassed:test selector) ifTrue:[ |
|
442 |
result := TestResult defaultResultClass new. |
|
443 |
result passed add: test. |
|
444 |
suiteAndResult := SuiteAndResult suite: suite result: result. |
|
445 |
self resultHolder value:suiteAndResult. |
|
12254 | 446 |
]. |
12308 | 447 |
]. |
448 |
] ensure:[ |
|
449 |
self runningHolder value:false. |
|
450 |
]. |
|
9954 | 451 |
|
452 |
"Created: / 15-03-2010 / 15:43:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10243
f8b2067424ed
changed: #debug: bug fix: if the test pass when debugging, update the UI
vrany
parents:
10201
diff
changeset
|
453 |
"Modified: / 07-07-2011 / 11:33:48 / Jan Vrany <jan.vrant@fit.cvut,cz>" |
12125 | 454 |
"Modified: / 22-08-2011 / 09:59:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
12254 | 455 |
"Modified: / 04-06-2012 / 19:46:38 / cg" |
9954 | 456 |
! |
457 |
||
458 |
run |
|
12125 | 459 |
|suite| |
9954 | 460 |
|
12125 | 461 |
resultHolder value isNil ifTrue:[ |
462 |
suite := self suiteForRun |
|
463 |
] ifFalse:[ |
|
464 |
suite := resultHolder value suiteForRun |
|
465 |
]. |
|
466 |
self run:suite |
|
9954 | 467 |
|
468 |
"Created: / 10-03-2010 / 19:42:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
12125 | 469 |
"Modified: / 22-08-2011 / 09:58:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
470 |
"Modified: / 09-10-2011 / 10:56:39 / cg" |
|
9954 | 471 |
! |
472 |
||
10175 | 473 |
run:suite |
12254 | 474 |
|suiteAndResult numTests| |
9954 | 475 |
|
10201 | 476 |
numTests := suite tests size. |
477 |
numTests == 0 ifTrue:[ |
|
10175 | 478 |
^ self |
479 |
]. |
|
9954 | 480 |
|
12254 | 481 |
self stop. |
482 |
||
483 |
testProcess := [ |
|
10175 | 484 |
|result incr run| |
9954 | 485 |
|
10175 | 486 |
[ |
12254 | 487 |
self runningHolder value:true. |
12262 | 488 |
self progressIndicatorShownHolder value:(numTests > 1). |
10175 | 489 |
self progressHolder value:0. |
10201 | 490 |
incr := 100 / numTests. |
10175 | 491 |
run := 0. |
492 |
result := suite |
|
493 |
runBeforeEachDo:[:test :result | |
|
494 |
infoHolder notNil ifTrue:[ |
|
495 |
infoHolder value:('Running "%1-%2"...' |
|
496 |
bindWith:test name |
|
497 |
with:test getTestName allBold) |
|
498 |
] |
|
499 |
] |
|
500 |
afterEachDo:[:test :result | |
|
501 |
run := run + 1. |
|
10184 | 502 |
self progressHolder value:(incr * run) truncated "rounded". |
10175 | 503 |
infoHolder notNil ifTrue:[ |
504 |
infoHolder value:('Done.') |
|
505 |
] |
|
506 |
]. |
|
507 |
suiteAndResult := SuiteAndResult suite:suite result:result. |
|
508 |
] ensure:[ |
|
12254 | 509 |
self progressIndicatorShownHolder value:false. |
10175 | 510 |
self resultHolder value:suiteAndResult. |
511 |
self runningHolder value:false. |
|
512 |
] |
|
513 |
] newProcess. |
|
12254 | 514 |
|
515 |
testProcess priority:(Processor userBackgroundPriority). |
|
516 |
testProcess resume. |
|
9954 | 517 |
|
518 |
"Created: / 11-03-2010 / 10:22:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
519 |
"Modified: / 06-09-2010 / 21:48:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
12262 | 520 |
"Modified: / 09-06-2012 / 20:23:58 / cg" |
9954 | 521 |
! |
522 |
||
523 |
runAll |
|
524 |
||
12254 | 525 |
self run: (self suiteForRunAll). |
9954 | 526 |
|
527 |
"Created: / 10-03-2010 / 19:42:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
528 |
"Modified: / 15-03-2010 / 13:12:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
12254 | 529 |
"Modified: / 04-06-2012 / 19:00:14 / cg" |
530 |
! |
|
531 |
||
532 |
runFailed |
|
533 |
self run: self suiteForRunFailed. |
|
534 |
||
535 |
"Created: / 04-06-2012 / 18:32:19 / cg" |
|
10178 | 536 |
! |
537 |
||
538 |
runWithDebug |
|
539 |
"/ cg: I really do not want to run them twice to get a debugger |
|
540 |
"/ - I want to run them either with a debugger coming right away, or not. |
|
541 |
||
12125 | 542 |
| suiteAndResult suite| |
10178 | 543 |
|
544 |
suiteAndResult := self resultHolder value. |
|
12125 | 545 |
suiteAndResult isNil ifTrue:[ |
546 |
suite := self suiteForRun. |
|
547 |
] ifFalse:[ |
|
548 |
suite := suiteAndResult suiteForRun. |
|
549 |
]. |
|
10608 | 550 |
|
12125 | 551 |
suite run: TestResultForRunWithDebug new |
10178 | 552 |
|
553 |
||
554 |
||
555 |
"/ suiteAndResult suite tests size ~= 1 ifTrue:[^self breakPoint: #jv]. |
|
556 |
"/ [suiteAndResult suite tests anyOne debug] fork |
|
557 |
||
558 |
"Created: / 05-07-2011 / 18:45:43 / cg" |
|
12125 | 559 |
"Modified: / 22-08-2011 / 09:59:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
560 |
"Modified: / 09-10-2011 / 10:55:46 / cg" |
|
12254 | 561 |
! |
562 |
||
563 |
stop |
|
564 |
|p| |
|
565 |
||
566 |
(p := testProcess) notNil ifTrue:[ |
|
567 |
testProcess := nil. |
|
568 |
p terminate |
|
569 |
]. |
|
570 |
||
571 |
"Created: / 04-06-2012 / 18:34:07 / cg" |
|
9954 | 572 |
! ! |
573 |
||
574 |
!TestRunnerEmbedded methodsFor:'aspects'! |
|
575 |
||
576 |
debugVisibleAspect |
|
10432 | 577 |
^ BlockValue |
578 |
with:[:model | |
|
579 |
model notNil |
|
580 |
and:[ model testCount == 1 |
|
581 |
and:[ model hasFailuresOrErrors ]] |
|
582 |
] |
|
583 |
argument:self resultHolder |
|
9954 | 584 |
|
585 |
"Created: / 15-03-2010 / 15:40:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10432 | 586 |
"Modified: / 02-08-2011 / 18:19:14 / cg" |
9954 | 587 |
! |
588 |
||
589 |
methodGeneratorHolder |
|
590 |
"return/create the 'methodGeneratorHolder' value holder (automatically generated)" |
|
591 |
||
592 |
methodGeneratorHolder isNil ifTrue:[ |
|
593 |
methodGeneratorHolder := ValueHolder new. |
|
594 |
methodGeneratorHolder addDependent:self. |
|
595 |
]. |
|
596 |
^ methodGeneratorHolder |
|
597 |
! |
|
598 |
||
599 |
methodGeneratorHolder:something |
|
600 |
"set the 'methodGeneratorHolder' value holder (automatically generated)" |
|
601 |
||
602 |
|oldValue newValue| |
|
603 |
||
604 |
methodGeneratorHolder notNil ifTrue:[ |
|
605 |
oldValue := methodGeneratorHolder value. |
|
606 |
methodGeneratorHolder removeDependent:self. |
|
607 |
]. |
|
608 |
methodGeneratorHolder := something. |
|
609 |
methodGeneratorHolder notNil ifTrue:[ |
|
610 |
methodGeneratorHolder addDependent:self. |
|
611 |
]. |
|
612 |
newValue := methodGeneratorHolder value. |
|
613 |
oldValue ~~ newValue ifTrue:[ |
|
614 |
self update:#value with:newValue from:methodGeneratorHolder. |
|
615 |
]. |
|
616 |
! |
|
617 |
||
12254 | 618 |
notRunningHolder |
619 |
^ BlockValue forLogicalNot:(self runningHolder) |
|
620 |
||
621 |
"Created: / 04-06-2012 / 18:38:48 / cg" |
|
622 |
! |
|
623 |
||
9954 | 624 |
progressHolder |
625 |
"return/create the 'progressHolder' value holder (automatically generated)" |
|
626 |
||
627 |
progressHolder isNil ifTrue:[ |
|
628 |
progressHolder := ValueHolder new. |
|
629 |
]. |
|
630 |
^ progressHolder |
|
631 |
! |
|
632 |
||
12254 | 633 |
progressIndicatorShownHolder |
634 |
progressIndicatorShownHolder isNil ifTrue:[ |
|
635 |
progressIndicatorShownHolder := ValueHolder with: false. |
|
636 |
]. |
|
637 |
^ progressIndicatorShownHolder |
|
638 |
||
639 |
"Modified: / 15-03-2010 / 20:29:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
640 |
"Modified (comment): / 04-06-2012 / 18:38:52 / cg" |
|
641 |
"Created: / 04-06-2012 / 19:42:59 / cg" |
|
642 |
! |
|
643 |
||
9954 | 644 |
resultBackgroundColorAspect |
645 |
<resource: #uiAspect> |
|
646 |
resultBackgroundColorHolder isNil ifTrue:[ |
|
10165
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
647 |
resultBackgroundColorHolder := BlockValue |
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
648 |
with:[:result :running | |
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
649 |
running ifTrue:[ |
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
650 |
self class currentlyRunningColor "/ View defaultBackgroundColor |
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
651 |
] ifFalse:[ |
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
652 |
result ifNil:[ self class notRunColor ] ifNotNil:[ result color ] |
12254 | 653 |
]. |
10165
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
654 |
] |
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
655 |
argument:self resultHolder |
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
656 |
argument:self runningHolder. |
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
657 |
resultBackgroundColorHolder |
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
658 |
onChangeEvaluate:[ |
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
659 |
runnerPanel |
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
660 |
ifNotNil:[ runnerPanel backgroundColor:resultBackgroundColorHolder value ] |
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
661 |
]. |
9954 | 662 |
]. |
663 |
^ resultBackgroundColorHolder. |
|
664 |
||
665 |
"Created: / 15-03-2010 / 15:22:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
666 |
"Modified: / 15-03-2010 / 21:02:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
12254 | 667 |
"Modified: / 04-06-2012 / 19:40:11 / cg" |
9954 | 668 |
! |
669 |
||
670 |
resultHolder |
|
671 |
"return/create the 'resultHolder' value holder (automatically generated)" |
|
672 |
||
673 |
resultHolder isNil ifTrue:[ |
|
674 |
resultHolder := ValueHolder new. |
|
675 |
]. |
|
676 |
^ resultHolder |
|
677 |
! |
|
678 |
||
679 |
resultInfoAspect |
|
10432 | 680 |
^ BlockValue |
681 |
with:[:model | model isNil ifTrue:[ '' ] ifFalse:[ model info ] ] |
|
682 |
argument:self resultHolder |
|
9954 | 683 |
|
684 |
"Created: / 15-03-2010 / 20:22:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10432 | 685 |
"Modified: / 02-08-2011 / 18:20:26 / cg" |
9954 | 686 |
! |
687 |
||
688 |
resultNameAspect |
|
10432 | 689 |
^ BlockValue |
690 |
with:[:model | model isNil ifTrue:[ 'Run the tests!!' ] ifFalse:[ model name ] ] |
|
691 |
argument:self resultHolder |
|
9954 | 692 |
|
693 |
"Created: / 15-03-2010 / 14:57:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
694 |
"Modified: / 15-03-2010 / 20:17:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10432 | 695 |
"Modified: / 02-08-2011 / 18:20:38 / cg" |
9954 | 696 |
! |
697 |
||
698 |
runAllEnabledHolder |
|
699 |
||
12254 | 700 |
^ self notRunningHolder |
9954 | 701 |
|
702 |
"Created: / 07-09-2010 / 09:15:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
12254 | 703 |
"Modified: / 04-06-2012 / 18:40:46 / cg" |
9954 | 704 |
! |
705 |
||
706 |
runEnabledHolder |
|
707 |
^BlockValue |
|
708 |
with: |
|
12254 | 709 |
[:result :running | |
710 |
||
711 |
running not |
|
712 |
and:[ result notNil |
|
713 |
and:[ result testCount > 0 ]] |
|
714 |
] |
|
9954 | 715 |
argument: self resultHolder |
12254 | 716 |
argument: self runningHolder |
9954 | 717 |
|
718 |
"Created: / 07-09-2010 / 09:15:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
12254 | 719 |
"Modified: / 04-06-2012 / 18:52:41 / cg" |
720 |
! |
|
721 |
||
722 |
runFailedEnabledHolder |
|
723 |
^BlockValue |
|
724 |
with: |
|
725 |
[:running | |
|
726 |
||
727 |
|result| |
|
728 |
||
12262 | 729 |
running not |
730 |
and:[ TestResult notNil |
|
731 |
and:[ TestResult isLoaded |
|
732 |
and:[ result := self resultForSuite:self suiteForRunAll. result notNil |
|
733 |
and:[ result hasFailuresOrErrors ]]]] |
|
12254 | 734 |
] |
735 |
"/ argument: self resultHolder |
|
736 |
argument: self runningHolder |
|
737 |
||
738 |
"Created: / 07-09-2010 / 09:15:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
739 |
"Created: / 04-06-2012 / 18:28:12 / cg" |
|
12262 | 740 |
"Modified: / 18-07-2012 / 09:55:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9954 | 741 |
! |
742 |
||
743 |
runningHolder |
|
744 |
runningHolder isNil ifTrue:[ |
|
745 |
runningHolder := ValueHolder with: false. |
|
746 |
]. |
|
747 |
^ runningHolder |
|
748 |
||
749 |
"Modified: / 15-03-2010 / 20:29:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
12254 | 750 |
"Modified (comment): / 04-06-2012 / 18:38:52 / cg" |
9954 | 751 |
! |
752 |
||
753 |
selectedClassesHolder |
|
754 |
"return/create the 'selectedClassesHolder' value holder (automatically generated)" |
|
755 |
||
756 |
selectedClassesHolder isNil ifTrue:[ |
|
757 |
selectedClassesHolder := ValueHolder new. |
|
758 |
selectedClassesHolder addDependent:self. |
|
759 |
]. |
|
760 |
^ selectedClassesHolder |
|
761 |
! |
|
762 |
||
763 |
selectedClassesHolder:something |
|
764 |
"set the 'selectedClassesHolder' value holder (automatically generated)" |
|
765 |
||
766 |
|oldValue newValue| |
|
767 |
||
768 |
selectedClassesHolder notNil ifTrue:[ |
|
769 |
oldValue := selectedClassesHolder value. |
|
770 |
selectedClassesHolder removeDependent:self. |
|
771 |
]. |
|
772 |
selectedClassesHolder := something. |
|
773 |
selectedClassesHolder notNil ifTrue:[ |
|
774 |
selectedClassesHolder addDependent:self. |
|
775 |
]. |
|
776 |
newValue := selectedClassesHolder value. |
|
777 |
oldValue ~~ newValue ifTrue:[ |
|
778 |
self update:#value with:newValue from:selectedClassesHolder. |
|
779 |
]. |
|
780 |
! |
|
781 |
||
782 |
selectedMethodsHolder |
|
783 |
"return/create the 'selectedMethodsHolder' value holder (automatically generated)" |
|
784 |
||
785 |
selectedMethodsHolder isNil ifTrue:[ |
|
786 |
selectedMethodsHolder := ValueHolder new. |
|
787 |
selectedMethodsHolder addDependent:self. |
|
788 |
]. |
|
789 |
^ selectedMethodsHolder |
|
790 |
! |
|
791 |
||
792 |
selectedMethodsHolder:something |
|
793 |
"set the 'selectedMethodsHolder' value holder (automatically generated)" |
|
794 |
||
795 |
|oldValue newValue| |
|
796 |
||
797 |
selectedMethodsHolder notNil ifTrue:[ |
|
798 |
oldValue := selectedMethodsHolder value. |
|
799 |
selectedMethodsHolder removeDependent:self. |
|
800 |
]. |
|
801 |
selectedMethodsHolder := something. |
|
802 |
selectedMethodsHolder notNil ifTrue:[ |
|
803 |
selectedMethodsHolder addDependent:self. |
|
804 |
]. |
|
805 |
newValue := selectedMethodsHolder value. |
|
806 |
oldValue ~~ newValue ifTrue:[ |
|
807 |
self update:#value with:newValue from:selectedMethodsHolder. |
|
808 |
]. |
|
809 |
! |
|
810 |
||
811 |
selectedProtocolsHolder |
|
812 |
"return/create the 'selectedProtocolsHolder' value holder (automatically generated)" |
|
813 |
||
814 |
selectedProtocolsHolder isNil ifTrue:[ |
|
815 |
selectedProtocolsHolder := ValueHolder new. |
|
816 |
selectedProtocolsHolder addDependent:self. |
|
817 |
]. |
|
818 |
^ selectedProtocolsHolder |
|
819 |
! |
|
820 |
||
821 |
selectedProtocolsHolder:something |
|
822 |
"set the 'selectedProtocolsHolder' value holder (automatically generated)" |
|
823 |
||
824 |
|oldValue newValue| |
|
825 |
||
826 |
selectedProtocolsHolder notNil ifTrue:[ |
|
827 |
oldValue := selectedProtocolsHolder value. |
|
828 |
selectedProtocolsHolder removeDependent:self. |
|
829 |
]. |
|
830 |
selectedProtocolsHolder := something. |
|
831 |
selectedProtocolsHolder notNil ifTrue:[ |
|
832 |
selectedProtocolsHolder addDependent:self. |
|
833 |
]. |
|
834 |
newValue := selectedProtocolsHolder value. |
|
835 |
oldValue ~~ newValue ifTrue:[ |
|
836 |
self update:#value with:newValue from:selectedProtocolsHolder. |
|
837 |
]. |
|
12254 | 838 |
! |
839 |
||
840 |
stopEnabledHolder |
|
841 |
^ self runningHolder |
|
842 |
||
843 |
"Created: / 04-06-2012 / 18:29:01 / cg" |
|
9954 | 844 |
! ! |
845 |
||
846 |
!TestRunnerEmbedded methodsFor:'change & update'! |
|
847 |
||
12308 | 848 |
invalidateSuiteAndResult |
849 |
self resultHolder value:nil. |
|
850 |
! |
|
851 |
||
852 |
invalidateTestCases |
|
853 |
allTestCases := nil. |
|
854 |
! |
|
855 |
||
9954 | 856 |
update:aspect with:param from: sender |
857 |
"Invoked when an object that I depend upon sends a change notification." |
|
858 |
||
859 |
sender == selectedClassesHolder ifTrue:[ |
|
860 |
self |
|
12308 | 861 |
invalidateTestCases; "/ updateTestSuite; |
862 |
invalidateSuiteAndResult; "/ updateTestSuiteAndResult; |
|
9954 | 863 |
updateVisibility. |
12308 | 864 |
self enqueueDelayedAction:[ self updateTestCases; updateSuiteAndResult ]. |
9954 | 865 |
^ self. |
866 |
]. |
|
867 |
sender == selectedProtocolsHolder ifTrue:[ |
|
12308 | 868 |
self invalidateSuiteAndResult. "/ updateTestSuiteAndResult. |
869 |
self enqueueDelayedAction:[ self updateSuiteAndResult ]. |
|
9954 | 870 |
^self |
871 |
]. |
|
872 |
||
873 |
sender == selectedMethodsHolder ifTrue:[ |
|
12308 | 874 |
self invalidateSuiteAndResult. "/ updateTestSuiteAndResult. |
875 |
self enqueueDelayedAction:[ self updateSuiteAndResult ]. |
|
9954 | 876 |
^self |
877 |
]. |
|
878 |
sender == methodGeneratorHolder ifTrue:[ |
|
12308 | 879 |
self invalidateSuiteAndResult. "/ updateTestSuiteAndResult. |
880 |
self enqueueDelayedAction:[ self updateSuiteAndResult ]. |
|
9954 | 881 |
^self |
882 |
]. |
|
883 |
||
12125 | 884 |
sender == Smalltalk ifTrue:[ |
885 |
aspect == #lastTestRunResult ifTrue:[ |
|
12308 | 886 |
allTestCases notNil ifTrue:[ |
887 |
(allTestCases includesIdentical: param first) ifTrue:[ |
|
888 |
self invalidateSuiteAndResult. "/ updateTestSuiteAndResult. |
|
889 |
self enqueueDelayedAction:[ self updateSuiteAndResult ]. |
|
890 |
^self |
|
891 |
] |
|
892 |
]. |
|
12125 | 893 |
] |
894 |
]. |
|
895 |
||
9954 | 896 |
|
897 |
||
898 |
super update:aspect with:param from: sender |
|
899 |
||
12125 | 900 |
"Modified: / 20-11-2011 / 12:40:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
12254 | 901 |
"Modified: / 04-06-2012 / 19:03:34 / cg" |
9954 | 902 |
! |
903 |
||
12308 | 904 |
updateSuiteAndResult |
905 |
| suite suiteAndResult | |
|
906 |
||
907 |
self runningHolder value ifTrue:[^self]. |
|
908 |
self allTestCases isEmptyOrNil ifTrue:[^self]. |
|
909 |
||
910 |
suiteAndResult := SuiteAndResult |
|
911 |
suite: (suite := self suiteForRun) |
|
912 |
result: (self resultForSuite: suite). |
|
913 |
self resultHolder value: suiteAndResult. |
|
914 |
||
915 |
"Created: / 15-03-2010 / 19:41:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
916 |
"Modified: / 15-03-2010 / 20:55:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
917 |
"Modified: / 04-06-2012 / 19:03:15 / cg" |
|
918 |
! |
|
919 |
||
9954 | 920 |
updateTestCases |
12254 | 921 |
allTestCases := ((self selectedClassesHolder value ? #()) |
9954 | 922 |
select:[:cls | self isTestCaseLike:cls ]). |
12254 | 923 |
allTestCases := allTestCases asArray |
9954 | 924 |
|
925 |
"Created: / 11-03-2010 / 10:31:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
12125 | 926 |
"Modified: / 24-01-2012 / 22:09:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
12254 | 927 |
"Modified: / 04-06-2012 / 19:02:52 / cg" |
9954 | 928 |
! |
929 |
||
12309
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
930 |
updateTestSuiteAndResult |
9954 | 931 |
|
12309
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
932 |
| suite suiteAndResult | |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
933 |
self runningHolder value ifTrue:[^self]. |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
934 |
allTestCases isEmptyOrNil ifTrue:[^self]. |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
935 |
suiteAndResult := SuiteAndResult |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
936 |
suite: (suite := self suiteForRun) |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
937 |
result: (self resultForSuite: suite). |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
938 |
self resultHolder value: suiteAndResult. |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
939 |
|
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
940 |
"Created: / 15-03-2010 / 19:41:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
941 |
"Modified: / 15-03-2010 / 20:55:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
942 |
"Modified: / 04-06-2012 / 19:03:15 / cg" |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
943 |
! |
9954 | 944 |
|
945 |
updateVisibility |
|
946 |
||
947 |
self hasTestCaseSelected |
|
948 |
ifTrue:[self show] |
|
949 |
ifFalse:[self hide] |
|
950 |
||
951 |
"Created: / 11-03-2010 / 09:02:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
952 |
! ! |
|
953 |
||
954 |
!TestRunnerEmbedded methodsFor:'hooks'! |
|
955 |
||
12125 | 956 |
commonPostOpen |
957 |
||
958 |
Smalltalk addDependent: self. |
|
959 |
||
960 |
"Created: / 17-11-2011 / 20:59:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
961 |
! |
|
962 |
||
9954 | 963 |
postBuildRunnerPanel: aView |
964 |
||
965 |
runnerPanel := aView. |
|
966 |
runnerPanel backgroundColor: self resultBackgroundColorAspect value |
|
967 |
||
968 |
"Created: / 15-03-2010 / 14:26:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
12125 | 969 |
! |
970 |
||
971 |
releaseAsSubCanvas |
|
972 |
||
973 |
Smalltalk removeDependent: self. |
|
974 |
||
975 |
"Created: / 17-11-2011 / 21:03:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
9954 | 976 |
! ! |
977 |
||
978 |
!TestRunnerEmbedded methodsFor:'private'! |
|
979 |
||
980 |
hide |
|
981 |
||
982 |
self visibility: false height: 0 |
|
983 |
||
984 |
"Created: / 11-03-2010 / 09:07:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
985 |
! |
|
986 |
||
987 |
isTestCaseLike:cls |
|
988 |
||
989 |
^(super isTestCaseLike: cls) and: |
|
990 |
[(cls askFor: #isAbstract) not] |
|
991 |
||
992 |
"Modified: / 04-03-2011 / 06:54:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
993 |
! |
|
994 |
||
995 |
show |
|
996 |
||
997 |
self visibility: true height: 50 |
|
998 |
||
999 |
"Created: / 11-03-2010 / 09:07:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1000 |
! |
|
1001 |
||
10564
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
1002 |
visibility:visibility height:height |
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
1003 |
|container list h| |
9954 | 1004 |
|
10564
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
1005 |
(container := self window container) ifNil:[ ^ self ]. |
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
1006 |
h := visibility ifFalse:[0] ifTrue:[ height ]. |
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
1007 |
container isVisible == visibility ifFalse:[ |
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
1008 |
container isVisible:visibility |
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
1009 |
]. |
9954 | 1010 |
list := container container subViews first. |
10564
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
1011 |
(list layout bottomOffset ~= height negated) ifTrue:[ |
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
1012 |
list layout:((list layout) |
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
1013 |
bottomOffset:height negated; |
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
1014 |
yourself) |
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
1015 |
]. |
9954 | 1016 |
|
1017 |
"Created: / 11-03-2010 / 09:51:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1018 |
! ! |
|
1019 |
||
1020 |
!TestRunnerEmbedded methodsFor:'queries'! |
|
1021 |
||
1022 |
hasTestCaseSelected |
|
1023 |
||
12308 | 1024 |
^self allTestCases notEmptyOrNil |
9954 | 1025 |
|
1026 |
"Created: / 11-03-2010 / 09:06:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1027 |
"Modified: / 15-03-2010 / 20:54:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10454 | 1028 |
"Modified: / 04-08-2011 / 20:42:10 / cg" |
9954 | 1029 |
! ! |
1030 |
||
1031 |
!TestRunnerEmbedded methodsFor:'utilities'! |
|
1032 |
||
10432 | 1033 |
resultForSuite:suite |
1034 |
|result| |
|
9954 | 1035 |
|
12308 | 1036 |
result := TestResult defaultResultClass new. |
10432 | 1037 |
suite tests do:[:test | |
12125 | 1038 |
| sel cls | |
10432 | 1039 |
|
1040 |
sel := test selector. |
|
12125 | 1041 |
cls := test class. |
1042 |
(cls testSelectorPassed:sel) ifTrue:[ |
|
1043 |
result passedOutcomes add: (cls rememberedOutcomeFor: sel) |
|
10432 | 1044 |
] ifFalse:[ |
12125 | 1045 |
(cls testSelectorError:sel) ifTrue:[ |
1046 |
result errorOutcomes add:(cls rememberedOutcomeFor: sel) |
|
10432 | 1047 |
] ifFalse:[ |
12125 | 1048 |
(cls testSelectorFailed:sel) ifTrue:[ |
1049 |
result failureOutcomes add:(cls rememberedOutcomeFor: sel) |
|
10432 | 1050 |
] |
1051 |
] |
|
1052 |
] |
|
1053 |
]. |
|
1054 |
^ result |
|
9954 | 1055 |
|
1056 |
"Created: / 15-03-2010 / 19:46:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10432 | 1057 |
"Modified: / 02-08-2011 / 18:20:00 / cg" |
12125 | 1058 |
"Modified: / 20-08-2011 / 14:30:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9954 | 1059 |
! |
1060 |
||
1061 |
suiteForRun |
|
12303
b93ac7ba9280
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12262
diff
changeset
|
1062 |
| methods testMethods protocols suite selectedClass | |
10374 | 1063 |
|
1064 |
selectedClass := self theSingleTestCase. |
|
12308 | 1065 |
|
10563
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1066 |
(methods := selectedMethodsHolder value) notEmptyOrNil ifTrue:[ |
12303
b93ac7ba9280
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12262
diff
changeset
|
1067 |
testMethods := self selectedTestMethods. |
b93ac7ba9280
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12262
diff
changeset
|
1068 |
suite := TestSuite named: (self suiteNameFromMethods: testMethods). |
b93ac7ba9280
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12262
diff
changeset
|
1069 |
testMethods do:[:mthd| |
10563
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1070 |
| class selector | |
10374 | 1071 |
class := selectedClass ifNil:[mthd mclass]. |
10563
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1072 |
suite addTest: (class asTestCase selector: mthd selector) |
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1073 |
]. |
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1074 |
^suite |
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1075 |
]. |
9954 | 1076 |
|
10563
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1077 |
(protocols := selectedProtocolsHolder value) isEmptyOrNil ifFalse:[ |
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1078 |
suite := TestSuite named: (self suiteNameFromProtocols: protocols). |
12308 | 1079 |
(self selectedTestMethodsFromProtocols: protocols inClass:selectedClass) do:[:mthd| |
10563
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1080 |
| class selector | |
10374 | 1081 |
class := selectedClass ifNil:[mthd mclass]. |
10563
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1082 |
suite addTest: (mthd mclass asTestCase selector: mthd selector) |
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1083 |
]. |
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1084 |
^suite |
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1085 |
]. |
10374 | 1086 |
|
9954 | 1087 |
^self suiteForRunAll |
1088 |
||
1089 |
"Created: / 15-03-2010 / 13:13:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10454 | 1090 |
"Modified: / 04-08-2011 / 19:06:42 / cg" |
12303
b93ac7ba9280
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12262
diff
changeset
|
1091 |
"Modified: / 02-11-2012 / 11:17:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9954 | 1092 |
! |
1093 |
||
1094 |
suiteForRunAll |
|
1095 |
|suite| |
|
12308 | 1096 |
|
12254 | 1097 |
allTestCases isNil ifTrue:[ |
1098 |
self updateTestCases. |
|
1099 |
]. |
|
12308 | 1100 |
suite := TestSuite named:(self suiteNameFromClasses: self allTestCases). |
12254 | 1101 |
|
1102 |
allTestCases do:[:testCase | |
|
10563
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1103 |
suite addTests:(self buildSuiteFromClass:testCase) tests |
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1104 |
]. |
9954 | 1105 |
^suite |
1106 |
||
1107 |
"Modified: / 04-03-2011 / 06:57:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
12254 | 1108 |
"Modified: / 04-06-2012 / 19:01:48 / cg" |
1109 |
! |
|
1110 |
||
1111 |
suiteForRunFailed |
|
1112 |
|suite| |
|
1113 |
||
12308 | 1114 |
suite := TestSuite named:(self suiteNameFromClasses: self allTestCases). |
1115 |
self allTestCases do:[:testCase | |
|
12254 | 1116 |
(self buildSuiteFromClass:testCase) tests do:[:eachTest | |
1117 |
| sel cls | |
|
1118 |
||
1119 |
sel := eachTest selector. |
|
1120 |
cls := eachTest class. |
|
1121 |
(cls testSelectorPassed:sel) ifFalse:[ |
|
1122 |
suite addTest:eachTest |
|
1123 |
] |
|
1124 |
] |
|
1125 |
]. |
|
1126 |
^suite |
|
1127 |
||
1128 |
"Modified: / 04-03-2011 / 06:57:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1129 |
"Created: / 04-06-2012 / 18:32:40 / cg" |
|
9954 | 1130 |
! ! |
1131 |
||
1132 |
!TestRunnerEmbedded::SuiteAndResult class methodsFor:'instance creation'! |
|
1133 |
||
1134 |
suite: suite result: result |
|
1135 |
||
1136 |
^self new |
|
1137 |
suite: suite; |
|
1138 |
result: result. |
|
1139 |
||
1140 |
"Modified: / 15-03-2010 / 15:27:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1141 |
! ! |
|
1142 |
||
1143 |
!TestRunnerEmbedded::SuiteAndResult methodsFor:'accessing'! |
|
1144 |
||
1145 |
color |
|
1146 |
||
1147 |
self testCount == 0 ifTrue: |
|
1148 |
[^TestRunnerEmbedded notRunColor]. |
|
1149 |
||
1150 |
result ifNil:[^TestRunnerEmbedded notRunColor]. |
|
1151 |
self hasErrors ifTrue:[^TestRunnerEmbedded errorColor]. |
|
1152 |
self hasFailures ifTrue:[^TestRunnerEmbedded failedColor]. |
|
1153 |
self hasPassed ifTrue:[^TestRunnerEmbedded passedColor]. |
|
1154 |
^TestRunnerEmbedded notRunColor |
|
1155 |
||
1156 |
"Created: / 15-03-2010 / 15:24:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1157 |
"Modified: / 07-09-2010 / 08:25:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1158 |
! |
|
1159 |
||
1160 |
info |
|
1161 |
||
1162 |
result ifNil:[^'']. |
|
1163 |
(result passedCount + result failureCount + result errorCount) = 1 ifTrue:[^'']. |
|
1164 |
^'%1 tests, %2 passed, %3 failed, %4 errors' |
|
1165 |
bindWith: suite tests size |
|
1166 |
with: result passedCount |
|
1167 |
with: result failureCount |
|
1168 |
with: result errorCount |
|
1169 |
||
1170 |
"Created: / 15-03-2010 / 20:23:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1171 |
! |
|
1172 |
||
1173 |
name |
|
1174 |
||
1175 |
^suite name |
|
1176 |
||
1177 |
"Created: / 15-03-2010 / 15:12:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1178 |
! |
|
1179 |
||
1180 |
result |
|
1181 |
^ result |
|
1182 |
! |
|
1183 |
||
1184 |
result:aTestResult |
|
1185 |
result := aTestResult. |
|
1186 |
! |
|
1187 |
||
1188 |
suite |
|
1189 |
^ suite |
|
1190 |
! |
|
1191 |
||
1192 |
suite:aTestSuite |
|
1193 |
suite := aTestSuite. |
|
1194 |
! |
|
1195 |
||
12125 | 1196 |
suiteForRun |
1197 |
||
1198 |
| suiteForRun | |
|
1199 |
suiteForRun := suite class named: suite name. |
|
1200 |
suiteForRun addTests: |
|
1201 |
(suite tests collect:[:testCase|testCase class selector: testCase selector]). |
|
1202 |
^suiteForRun |
|
1203 |
||
1204 |
"Created: / 22-08-2011 / 09:56:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1205 |
! |
|
1206 |
||
9954 | 1207 |
testCount |
1208 |
||
1209 |
^suite tests size |
|
1210 |
||
1211 |
"Created: / 15-03-2010 / 15:44:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1212 |
! ! |
|
1213 |
||
1214 |
!TestRunnerEmbedded::SuiteAndResult methodsFor:'queries'! |
|
1215 |
||
1216 |
hasErrors |
|
1217 |
||
1218 |
^result errorCount > 0 |
|
1219 |
||
1220 |
"Created: / 15-03-2010 / 15:21:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1221 |
! |
|
1222 |
||
1223 |
hasFailures |
|
1224 |
||
1225 |
^result failureCount > 0 |
|
1226 |
||
1227 |
"Created: / 15-03-2010 / 15:21:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1228 |
! |
|
1229 |
||
1230 |
hasFailuresOrErrors |
|
1231 |
||
1232 |
^self hasErrors or:[self hasFailures] |
|
1233 |
||
1234 |
"Created: / 15-03-2010 / 15:45:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1235 |
! |
|
1236 |
||
1237 |
hasPassed |
|
1238 |
||
1239 |
^result passedCount > 0 |
|
1240 |
||
1241 |
"Created: / 15-03-2010 / 22:06:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1242 |
! ! |
|
1243 |
||
1244 |
!TestRunnerEmbedded class methodsFor:'documentation'! |
|
1245 |
||
10432 | 1246 |
version |
12309
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
1247 |
^ '$Id: Tools__TestRunnerEmbedded.st 8075 2012-12-01 00:04:32Z vranyj1 $' |
10432 | 1248 |
! |
1249 |
||
9954 | 1250 |
version_CVS |
12308 | 1251 |
^ '§Header: /cvs/stx/stx/libtool/Tools__TestRunnerEmbedded.st,v 1.32 2012/11/08 00:05:16 cg Exp §' |
9954 | 1252 |
! |
1253 |
||
1254 |
version_SVN |
|
12309
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
1255 |
^ '$Id: Tools__TestRunnerEmbedded.st 8075 2012-12-01 00:04:32Z vranyj1 $' |
12125 | 1256 |
! ! |