author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Thu, 04 Apr 2013 19:06:16 +0100 | |
branch | jv |
changeset 12650 | e0f607754b9a |
parent 12431 | 9f0c59c742d5 |
parent 12604 | 8d8912ec9551 |
child 12807 | ba8c5416aa28 |
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 |
||
30 |
AbstractTestRunner subclass:#TestRunnerEmbedded |
|
11552 | 31 |
instanceVariableNames:'runnerPanel selectedClassesHolder selectedProtocolsHolder |
32 |
selectedMethodsHolder methodGeneratorHolder resultHolder |
|
33 |
resultInfoHolder resultBackgroundColorHolder runningHolder |
|
11553 | 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 |
||
11553 | 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) |
|
11552 | 146 |
bounds: (Rectangle 0 0 595 50) |
9954 | 147 |
) |
148 |
component: |
|
149 |
(SpecCollection |
|
150 |
collection: ( |
|
11553 | 151 |
(ViewSpec |
152 |
name: 'Runner' |
|
9954 | 153 |
layout: (LayoutFrame 5 0 0 0 -5 1 0 1) |
11553 | 154 |
backgroundChannel: resultBackgroundColorAspect |
9954 | 155 |
component: |
156 |
(SpecCollection |
|
157 |
collection: ( |
|
11553 | 158 |
(HorizontalPanelViewSpec |
159 |
name: 'RunnerInnerBox' |
|
160 |
layout: (LayoutFrame 5 0 0 0 -5 1 0 1) |
|
9954 | 161 |
backgroundChannel: resultBackgroundColorAspect |
11553 | 162 |
horizontalLayout: rightSpaceFit |
163 |
verticalLayout: center |
|
164 |
horizontalSpace: 0 |
|
165 |
elementsChangeSize: true |
|
9954 | 166 |
component: |
167 |
(SpecCollection |
|
168 |
collection: ( |
|
11553 | 169 |
(ViewSpec |
170 |
name: 'RunnerInfoBox' |
|
171 |
backgroundChannel: resultBackgroundColorAspect |
|
9954 | 172 |
component: |
173 |
(SpecCollection |
|
174 |
collection: ( |
|
11553 | 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 |
11553 | 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: ( |
|
11553 | 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 |
) |
|
11553 | 215 |
extent: (Point 276 30) |
216 |
) |
|
217 |
(ActionButtonSpec |
|
11568 | 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 |
|
11553 | 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 |
) |
|
11553 | 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 |
||
11966
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
303 |
allTestCases |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
304 |
allTestCases isNil ifTrue:[ |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
305 |
self updateTestCases |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
306 |
]. |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
307 |
^ allTestCases |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
308 |
! |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
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 |
||
11966
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
318 |
invalidateAllTestCases |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
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 |
|
11966
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
370 |
selectedTestMethodsFromProtocols:protocols inClass:aTestClass |
10374 | 371 |
|
11966
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
372 |
|methods generator| |
9954 | 373 |
|
374 |
methods := Set new. |
|
375 |
generator := self methodGeneratorHolder value. |
|
10374 | 376 |
|
11552 | 377 |
generator notNil ifTrue:[ |
378 |
generator do: [:cls :cat :sel :mthd | |
|
379 |
(mthd notNil |
|
11966
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
380 |
and:[ (self isTestCaseLike:(aTestClass ? cls)) |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
381 |
and:[ (aTestClass ? cls) isTestSelector:sel ] ]) |
11552 | 382 |
ifTrue:[ methods add:mthd ] |
383 |
] |
|
384 |
] ifFalse:[ |
|
11966
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
385 |
self allTestCases do: [:cls | |
11552 | 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>" |
11552 | 398 |
"Modified (format): / 04-06-2012 / 19:05:32 / cg" |
10374 | 399 |
! |
400 |
||
11966
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
401 |
selectedTestMethodsInClass:testClass |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
402 |
^ (self selectedMethodsHolder value ? #()) select: |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
403 |
[:mthd | | cls | |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
404 |
(cls := testClass) isNil ifTrue:[cls := mthd mclass]. |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
405 |
(self isTestCaseLike:testClass) |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
406 |
and:[ testClass isTestSelector:mthd selector ] ] |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
407 |
|
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
408 |
"Created: / 15-03-2010 / 13:21:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
409 |
"Modified: / 22-07-2011 / 15:46:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
410 |
"Modified: / 02-08-2011 / 17:46:38 / cg" |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
411 |
! |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
412 |
|
10374 | 413 |
theSingleTestCase |
414 |
||
11966
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
415 |
self allTestCases isEmptyOrNil ifTrue:[^nil]. |
11552 | 416 |
allTestCases size > 1 ifTrue:[^nil]. |
10374 | 417 |
|
11552 | 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 |
|
12055 | 426 |
| suiteAndResult suite result | |
9954 | 427 |
|
428 |
suiteAndResult := self resultHolder value. |
|
10647
1e9912f9a0d8
Embedded test runner no longer reuse old testcase instances
vrany
parents:
10608
diff
changeset
|
429 |
suite := suiteAndResult suiteForRun. |
11553 | 430 |
"/ suite tests size ~= 1 ifTrue:[^self breakPoint: #jv]. |
431 |
"/ test := suiteAndResult suite tests anyOne. |
|
432 |
||
433 |
self stop. |
|
434 |
||
12055 | 435 |
"/ debug run is synchronous |
436 |
[ |
|
437 |
self runningHolder value:true. |
|
11553 | 438 |
|
12055 | 439 |
suite tests do:[:test | |
12310
bdd2106c15f5
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12309
diff
changeset
|
440 |
[ |
bdd2106c15f5
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12309
diff
changeset
|
441 |
test debug. |
bdd2106c15f5
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12309
diff
changeset
|
442 |
] on: AbortAllOperationRequest do:[:ex|]. |
12055 | 443 |
(test class testSelectorPassed:test selector) ifTrue:[ |
444 |
result := TestResult defaultResultClass new. |
|
445 |
result passed add: test. |
|
446 |
suiteAndResult := SuiteAndResult suite: suite result: result. |
|
447 |
self resultHolder value:suiteAndResult. |
|
11553 | 448 |
]. |
12055 | 449 |
]. |
450 |
] ensure:[ |
|
451 |
self runningHolder value:false. |
|
452 |
]. |
|
9954 | 453 |
|
454 |
"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
|
455 |
"Modified: / 07-07-2011 / 11:33:48 / Jan Vrany <jan.vrant@fit.cvut,cz>" |
11553 | 456 |
"Modified: / 04-06-2012 / 19:46:38 / cg" |
12310
bdd2106c15f5
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12309
diff
changeset
|
457 |
"Modified: / 03-12-2012 / 14:02:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9954 | 458 |
! |
459 |
||
460 |
run |
|
10789 | 461 |
|suite| |
9954 | 462 |
|
10789 | 463 |
resultHolder value isNil ifTrue:[ |
464 |
suite := self suiteForRun |
|
465 |
] ifFalse:[ |
|
466 |
suite := resultHolder value suiteForRun |
|
467 |
]. |
|
468 |
self run:suite |
|
9954 | 469 |
|
470 |
"Created: / 10-03-2010 / 19:42:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10647
1e9912f9a0d8
Embedded test runner no longer reuse old testcase instances
vrany
parents:
10608
diff
changeset
|
471 |
"Modified: / 22-08-2011 / 09:58:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10789 | 472 |
"Modified: / 09-10-2011 / 10:56:39 / cg" |
9954 | 473 |
! |
474 |
||
10175 | 475 |
run:suite |
12310
bdd2106c15f5
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12309
diff
changeset
|
476 |
^self run: suite debug: false |
bdd2106c15f5
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12309
diff
changeset
|
477 |
|
bdd2106c15f5
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12309
diff
changeset
|
478 |
"Created: / 11-03-2010 / 10:22:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
bdd2106c15f5
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12309
diff
changeset
|
479 |
"Modified: / 09-06-2012 / 20:23:58 / cg" |
bdd2106c15f5
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12309
diff
changeset
|
480 |
"Modified: / 03-12-2012 / 13:59:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
bdd2106c15f5
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12309
diff
changeset
|
481 |
! |
bdd2106c15f5
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12309
diff
changeset
|
482 |
|
bdd2106c15f5
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12309
diff
changeset
|
483 |
run:suite debug: debug |
11552 | 484 |
|suiteAndResult numTests| |
9954 | 485 |
|
10201 | 486 |
numTests := suite tests size. |
487 |
numTests == 0 ifTrue:[ |
|
10175 | 488 |
^ self |
489 |
]. |
|
9954 | 490 |
|
11552 | 491 |
self stop. |
492 |
||
493 |
testProcess := [ |
|
10175 | 494 |
|result incr run| |
9954 | 495 |
|
12310
bdd2106c15f5
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12309
diff
changeset
|
496 |
result := debug ifFalse:[TestResult new] ifTrue:[TestResultForRunWithDebug]. |
10175 | 497 |
[ |
11552 | 498 |
self runningHolder value:true. |
11570 | 499 |
self progressIndicatorShownHolder value:(numTests > 1). |
10175 | 500 |
self progressHolder value:0. |
10201 | 501 |
incr := 100 / numTests. |
10175 | 502 |
run := 0. |
503 |
result := suite |
|
12310
bdd2106c15f5
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12309
diff
changeset
|
504 |
run: result |
bdd2106c15f5
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12309
diff
changeset
|
505 |
beforeEachDo:[:test :result | |
10175 | 506 |
infoHolder notNil ifTrue:[ |
507 |
infoHolder value:('Running "%1-%2"...' |
|
508 |
bindWith:test name |
|
509 |
with:test getTestName allBold) |
|
510 |
] |
|
511 |
] |
|
512 |
afterEachDo:[:test :result | |
|
513 |
run := run + 1. |
|
10184 | 514 |
self progressHolder value:(incr * run) truncated "rounded". |
10175 | 515 |
infoHolder notNil ifTrue:[ |
516 |
infoHolder value:('Done.') |
|
517 |
] |
|
12310
bdd2106c15f5
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12309
diff
changeset
|
518 |
] |
bdd2106c15f5
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12309
diff
changeset
|
519 |
debug: debug. |
10175 | 520 |
suiteAndResult := SuiteAndResult suite:suite result:result. |
521 |
] ensure:[ |
|
11553 | 522 |
self progressIndicatorShownHolder value:false. |
10175 | 523 |
self resultHolder value:suiteAndResult. |
524 |
self runningHolder value:false. |
|
525 |
] |
|
526 |
] newProcess. |
|
11552 | 527 |
|
528 |
testProcess priority:(Processor userBackgroundPriority). |
|
529 |
testProcess resume. |
|
9954 | 530 |
|
12310
bdd2106c15f5
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12309
diff
changeset
|
531 |
"Created: / 03-12-2012 / 13:59:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9954 | 532 |
! |
533 |
||
534 |
runAll |
|
535 |
||
11552 | 536 |
self run: (self suiteForRunAll). |
9954 | 537 |
|
538 |
"Created: / 10-03-2010 / 19:42:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
539 |
"Modified: / 15-03-2010 / 13:12:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11552 | 540 |
"Modified: / 04-06-2012 / 19:00:14 / cg" |
541 |
! |
|
542 |
||
543 |
runFailed |
|
544 |
self run: self suiteForRunFailed. |
|
545 |
||
546 |
"Created: / 04-06-2012 / 18:32:19 / cg" |
|
10178 | 547 |
! |
548 |
||
549 |
runWithDebug |
|
550 |
"/ cg: I really do not want to run them twice to get a debugger |
|
551 |
"/ - I want to run them either with a debugger coming right away, or not. |
|
552 |
||
10606 | 553 |
| suiteAndResult suite| |
10178 | 554 |
|
555 |
suiteAndResult := self resultHolder value. |
|
10789 | 556 |
suiteAndResult isNil ifTrue:[ |
557 |
suite := self suiteForRun. |
|
558 |
] ifFalse:[ |
|
559 |
suite := suiteAndResult suiteForRun. |
|
560 |
]. |
|
10608 | 561 |
|
12310
bdd2106c15f5
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12309
diff
changeset
|
562 |
self run: suite debug: true |
10178 | 563 |
|
564 |
||
565 |
||
566 |
"/ suiteAndResult suite tests size ~= 1 ifTrue:[^self breakPoint: #jv]. |
|
567 |
"/ [suiteAndResult suite tests anyOne debug] fork |
|
568 |
||
569 |
"Created: / 05-07-2011 / 18:45:43 / cg" |
|
10789 | 570 |
"Modified: / 09-10-2011 / 10:55:46 / cg" |
12310
bdd2106c15f5
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12309
diff
changeset
|
571 |
"Modified: / 03-12-2012 / 13:59:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11552 | 572 |
! |
573 |
||
574 |
stop |
|
575 |
|p| |
|
576 |
||
577 |
(p := testProcess) notNil ifTrue:[ |
|
578 |
testProcess := nil. |
|
579 |
p terminate |
|
580 |
]. |
|
581 |
||
582 |
"Created: / 04-06-2012 / 18:34:07 / cg" |
|
9954 | 583 |
! ! |
584 |
||
585 |
!TestRunnerEmbedded methodsFor:'aspects'! |
|
586 |
||
587 |
debugVisibleAspect |
|
10432 | 588 |
^ BlockValue |
589 |
with:[:model | |
|
590 |
model notNil |
|
591 |
and:[ model testCount == 1 |
|
592 |
and:[ model hasFailuresOrErrors ]] |
|
593 |
] |
|
594 |
argument:self resultHolder |
|
9954 | 595 |
|
596 |
"Created: / 15-03-2010 / 15:40:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10432 | 597 |
"Modified: / 02-08-2011 / 18:19:14 / cg" |
9954 | 598 |
! |
599 |
||
600 |
methodGeneratorHolder |
|
601 |
"return/create the 'methodGeneratorHolder' value holder (automatically generated)" |
|
602 |
||
603 |
methodGeneratorHolder isNil ifTrue:[ |
|
604 |
methodGeneratorHolder := ValueHolder new. |
|
605 |
methodGeneratorHolder addDependent:self. |
|
606 |
]. |
|
607 |
^ methodGeneratorHolder |
|
608 |
! |
|
609 |
||
610 |
methodGeneratorHolder:something |
|
611 |
"set the 'methodGeneratorHolder' value holder (automatically generated)" |
|
612 |
||
613 |
|oldValue newValue| |
|
614 |
||
615 |
methodGeneratorHolder notNil ifTrue:[ |
|
616 |
oldValue := methodGeneratorHolder value. |
|
617 |
methodGeneratorHolder removeDependent:self. |
|
618 |
]. |
|
619 |
methodGeneratorHolder := something. |
|
620 |
methodGeneratorHolder notNil ifTrue:[ |
|
621 |
methodGeneratorHolder addDependent:self. |
|
622 |
]. |
|
623 |
newValue := methodGeneratorHolder value. |
|
624 |
oldValue ~~ newValue ifTrue:[ |
|
625 |
self update:#value with:newValue from:methodGeneratorHolder. |
|
626 |
]. |
|
627 |
! |
|
628 |
||
11552 | 629 |
notRunningHolder |
630 |
^ BlockValue forLogicalNot:(self runningHolder) |
|
631 |
||
632 |
"Created: / 04-06-2012 / 18:38:48 / cg" |
|
633 |
! |
|
634 |
||
9954 | 635 |
progressHolder |
636 |
"return/create the 'progressHolder' value holder (automatically generated)" |
|
637 |
||
638 |
progressHolder isNil ifTrue:[ |
|
639 |
progressHolder := ValueHolder new. |
|
640 |
]. |
|
641 |
^ progressHolder |
|
642 |
! |
|
643 |
||
11553 | 644 |
progressIndicatorShownHolder |
645 |
progressIndicatorShownHolder isNil ifTrue:[ |
|
646 |
progressIndicatorShownHolder := ValueHolder with: false. |
|
647 |
]. |
|
648 |
^ progressIndicatorShownHolder |
|
649 |
||
650 |
"Modified: / 15-03-2010 / 20:29:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
651 |
"Modified (comment): / 04-06-2012 / 18:38:52 / cg" |
|
652 |
"Created: / 04-06-2012 / 19:42:59 / cg" |
|
653 |
! |
|
654 |
||
9954 | 655 |
resultBackgroundColorAspect |
656 |
<resource: #uiAspect> |
|
657 |
resultBackgroundColorHolder isNil ifTrue:[ |
|
10165
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
658 |
resultBackgroundColorHolder := BlockValue |
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
659 |
with:[:result :running | |
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
660 |
running ifTrue:[ |
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
661 |
self class currentlyRunningColor "/ View defaultBackgroundColor |
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
662 |
] ifFalse:[ |
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
663 |
result ifNil:[ self class notRunColor ] ifNotNil:[ result color ] |
11553 | 664 |
]. |
10165
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
665 |
] |
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
666 |
argument:self resultHolder |
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
667 |
argument:self runningHolder. |
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
668 |
resultBackgroundColorHolder |
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
669 |
onChangeEvaluate:[ |
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
670 |
runnerPanel |
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
671 |
ifNotNil:[ runnerPanel backgroundColor:resultBackgroundColorHolder value ] |
fd4de5081321
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10092
diff
changeset
|
672 |
]. |
9954 | 673 |
]. |
674 |
^ resultBackgroundColorHolder. |
|
675 |
||
676 |
"Created: / 15-03-2010 / 15:22:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
677 |
"Modified: / 15-03-2010 / 21:02:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11553 | 678 |
"Modified: / 04-06-2012 / 19:40:11 / cg" |
9954 | 679 |
! |
680 |
||
681 |
resultHolder |
|
682 |
"return/create the 'resultHolder' value holder (automatically generated)" |
|
683 |
||
684 |
resultHolder isNil ifTrue:[ |
|
685 |
resultHolder := ValueHolder new. |
|
686 |
]. |
|
687 |
^ resultHolder |
|
688 |
! |
|
689 |
||
690 |
resultInfoAspect |
|
10432 | 691 |
^ BlockValue |
692 |
with:[:model | model isNil ifTrue:[ '' ] ifFalse:[ model info ] ] |
|
693 |
argument:self resultHolder |
|
9954 | 694 |
|
695 |
"Created: / 15-03-2010 / 20:22:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10432 | 696 |
"Modified: / 02-08-2011 / 18:20:26 / cg" |
9954 | 697 |
! |
698 |
||
699 |
resultNameAspect |
|
10432 | 700 |
^ BlockValue |
701 |
with:[:model | model isNil ifTrue:[ 'Run the tests!!' ] ifFalse:[ model name ] ] |
|
702 |
argument:self resultHolder |
|
9954 | 703 |
|
704 |
"Created: / 15-03-2010 / 14:57:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
705 |
"Modified: / 15-03-2010 / 20:17:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10432 | 706 |
"Modified: / 02-08-2011 / 18:20:38 / cg" |
9954 | 707 |
! |
708 |
||
709 |
runAllEnabledHolder |
|
710 |
||
11552 | 711 |
^ self notRunningHolder |
9954 | 712 |
|
713 |
"Created: / 07-09-2010 / 09:15:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11552 | 714 |
"Modified: / 04-06-2012 / 18:40:46 / cg" |
9954 | 715 |
! |
716 |
||
717 |
runEnabledHolder |
|
718 |
^BlockValue |
|
719 |
with: |
|
11552 | 720 |
[:result :running | |
721 |
||
722 |
running not |
|
723 |
and:[ result notNil |
|
724 |
and:[ result testCount > 0 ]] |
|
725 |
] |
|
9954 | 726 |
argument: self resultHolder |
11552 | 727 |
argument: self runningHolder |
9954 | 728 |
|
729 |
"Created: / 07-09-2010 / 09:15:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11552 | 730 |
"Modified: / 04-06-2012 / 18:52:41 / cg" |
731 |
! |
|
732 |
||
733 |
runFailedEnabledHolder |
|
734 |
^BlockValue |
|
735 |
with: |
|
736 |
[:running | |
|
737 |
||
738 |
|result| |
|
739 |
||
11584 | 740 |
running not |
11600
53100c5a7473
changed: #runFailedEnabledHolder (fix for environments without SUnit loaded)
vrany
parents:
11584
diff
changeset
|
741 |
and:[ TestResult notNil |
11584 | 742 |
and:[ TestResult isLoaded |
743 |
and:[ result := self resultForSuite:self suiteForRunAll. result notNil |
|
11600
53100c5a7473
changed: #runFailedEnabledHolder (fix for environments without SUnit loaded)
vrany
parents:
11584
diff
changeset
|
744 |
and:[ result hasFailuresOrErrors ]]]] |
11552 | 745 |
] |
746 |
"/ argument: self resultHolder |
|
747 |
argument: self runningHolder |
|
748 |
||
749 |
"Created: / 07-09-2010 / 09:15:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
750 |
"Created: / 04-06-2012 / 18:28:12 / cg" |
|
11600
53100c5a7473
changed: #runFailedEnabledHolder (fix for environments without SUnit loaded)
vrany
parents:
11584
diff
changeset
|
751 |
"Modified: / 18-07-2012 / 09:55:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9954 | 752 |
! |
753 |
||
754 |
runningHolder |
|
755 |
runningHolder isNil ifTrue:[ |
|
756 |
runningHolder := ValueHolder with: false. |
|
757 |
]. |
|
758 |
^ runningHolder |
|
759 |
||
760 |
"Modified: / 15-03-2010 / 20:29:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11552 | 761 |
"Modified (comment): / 04-06-2012 / 18:38:52 / cg" |
9954 | 762 |
! |
763 |
||
764 |
selectedClassesHolder |
|
765 |
"return/create the 'selectedClassesHolder' value holder (automatically generated)" |
|
766 |
||
767 |
selectedClassesHolder isNil ifTrue:[ |
|
768 |
selectedClassesHolder := ValueHolder new. |
|
769 |
selectedClassesHolder addDependent:self. |
|
770 |
]. |
|
771 |
^ selectedClassesHolder |
|
772 |
! |
|
773 |
||
774 |
selectedClassesHolder:something |
|
775 |
"set the 'selectedClassesHolder' value holder (automatically generated)" |
|
776 |
||
777 |
|oldValue newValue| |
|
778 |
||
779 |
selectedClassesHolder notNil ifTrue:[ |
|
780 |
oldValue := selectedClassesHolder value. |
|
781 |
selectedClassesHolder removeDependent:self. |
|
782 |
]. |
|
783 |
selectedClassesHolder := something. |
|
784 |
selectedClassesHolder notNil ifTrue:[ |
|
785 |
selectedClassesHolder addDependent:self. |
|
786 |
]. |
|
787 |
newValue := selectedClassesHolder value. |
|
788 |
oldValue ~~ newValue ifTrue:[ |
|
789 |
self update:#value with:newValue from:selectedClassesHolder. |
|
790 |
]. |
|
791 |
! |
|
792 |
||
793 |
selectedMethodsHolder |
|
794 |
"return/create the 'selectedMethodsHolder' value holder (automatically generated)" |
|
795 |
||
796 |
selectedMethodsHolder isNil ifTrue:[ |
|
797 |
selectedMethodsHolder := ValueHolder new. |
|
798 |
selectedMethodsHolder addDependent:self. |
|
799 |
]. |
|
800 |
^ selectedMethodsHolder |
|
801 |
! |
|
802 |
||
803 |
selectedMethodsHolder:something |
|
804 |
"set the 'selectedMethodsHolder' value holder (automatically generated)" |
|
805 |
||
806 |
|oldValue newValue| |
|
807 |
||
808 |
selectedMethodsHolder notNil ifTrue:[ |
|
809 |
oldValue := selectedMethodsHolder value. |
|
810 |
selectedMethodsHolder removeDependent:self. |
|
811 |
]. |
|
812 |
selectedMethodsHolder := something. |
|
813 |
selectedMethodsHolder notNil ifTrue:[ |
|
814 |
selectedMethodsHolder addDependent:self. |
|
815 |
]. |
|
816 |
newValue := selectedMethodsHolder value. |
|
817 |
oldValue ~~ newValue ifTrue:[ |
|
818 |
self update:#value with:newValue from:selectedMethodsHolder. |
|
819 |
]. |
|
820 |
! |
|
821 |
||
822 |
selectedProtocolsHolder |
|
823 |
"return/create the 'selectedProtocolsHolder' value holder (automatically generated)" |
|
824 |
||
825 |
selectedProtocolsHolder isNil ifTrue:[ |
|
826 |
selectedProtocolsHolder := ValueHolder new. |
|
827 |
selectedProtocolsHolder addDependent:self. |
|
828 |
]. |
|
829 |
^ selectedProtocolsHolder |
|
830 |
! |
|
831 |
||
832 |
selectedProtocolsHolder:something |
|
833 |
"set the 'selectedProtocolsHolder' value holder (automatically generated)" |
|
834 |
||
835 |
|oldValue newValue| |
|
836 |
||
837 |
selectedProtocolsHolder notNil ifTrue:[ |
|
838 |
oldValue := selectedProtocolsHolder value. |
|
839 |
selectedProtocolsHolder removeDependent:self. |
|
840 |
]. |
|
841 |
selectedProtocolsHolder := something. |
|
842 |
selectedProtocolsHolder notNil ifTrue:[ |
|
843 |
selectedProtocolsHolder addDependent:self. |
|
844 |
]. |
|
845 |
newValue := selectedProtocolsHolder value. |
|
846 |
oldValue ~~ newValue ifTrue:[ |
|
847 |
self update:#value with:newValue from:selectedProtocolsHolder. |
|
848 |
]. |
|
11552 | 849 |
! |
850 |
||
851 |
stopEnabledHolder |
|
852 |
^ self runningHolder |
|
853 |
||
854 |
"Created: / 04-06-2012 / 18:29:01 / cg" |
|
9954 | 855 |
! ! |
856 |
||
857 |
!TestRunnerEmbedded methodsFor:'change & update'! |
|
858 |
||
11966
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
859 |
invalidateSuiteAndResult |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
860 |
self resultHolder value:nil. |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
861 |
! |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
862 |
|
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
863 |
invalidateTestCases |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
864 |
allTestCases := nil. |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
865 |
! |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
866 |
|
9954 | 867 |
update:aspect with:param from: sender |
868 |
"Invoked when an object that I depend upon sends a change notification." |
|
869 |
||
870 |
sender == selectedClassesHolder ifTrue:[ |
|
871 |
self |
|
11966
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
872 |
invalidateTestCases; "/ updateTestSuite; |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
873 |
invalidateSuiteAndResult; "/ updateTestSuiteAndResult; |
9954 | 874 |
updateVisibility. |
11966
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
875 |
self enqueueDelayedAction:[ self updateTestCases; updateSuiteAndResult ]. |
9954 | 876 |
^ self. |
877 |
]. |
|
878 |
sender == selectedProtocolsHolder ifTrue:[ |
|
11966
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
879 |
self invalidateSuiteAndResult. "/ updateTestSuiteAndResult. |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
880 |
self enqueueDelayedAction:[ self updateSuiteAndResult ]. |
9954 | 881 |
^self |
882 |
]. |
|
883 |
||
884 |
sender == selectedMethodsHolder ifTrue:[ |
|
11966
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
885 |
self invalidateSuiteAndResult. "/ updateTestSuiteAndResult. |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
886 |
self enqueueDelayedAction:[ self updateSuiteAndResult ]. |
9954 | 887 |
^self |
888 |
]. |
|
889 |
sender == methodGeneratorHolder ifTrue:[ |
|
11966
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
890 |
self invalidateSuiteAndResult. "/ updateTestSuiteAndResult. |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
891 |
self enqueueDelayedAction:[ self updateSuiteAndResult ]. |
9954 | 892 |
^self |
893 |
]. |
|
894 |
||
10862 | 895 |
sender == Smalltalk ifTrue:[ |
896 |
aspect == #lastTestRunResult ifTrue:[ |
|
11966
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
897 |
allTestCases notNil ifTrue:[ |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
898 |
(allTestCases includesIdentical: param first) ifTrue:[ |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
899 |
self invalidateSuiteAndResult. "/ updateTestSuiteAndResult. |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
900 |
self enqueueDelayedAction:[ self updateSuiteAndResult ]. |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
901 |
^self |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
902 |
] |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
903 |
]. |
10862 | 904 |
] |
905 |
]. |
|
906 |
||
9954 | 907 |
|
908 |
||
909 |
super update:aspect with:param from: sender |
|
910 |
||
10886
8619db59aff4
bug fix in: #update:with:from: (selectedTestCases ivar might be nil)
vrany
parents:
10862
diff
changeset
|
911 |
"Modified: / 20-11-2011 / 12:40:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11552 | 912 |
"Modified: / 04-06-2012 / 19:03:34 / cg" |
9954 | 913 |
! |
914 |
||
11966
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
915 |
updateSuiteAndResult |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
916 |
| suite suiteAndResult | |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
917 |
|
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
918 |
self runningHolder value ifTrue:[^self]. |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
919 |
self allTestCases isEmptyOrNil ifTrue:[^self]. |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
920 |
|
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
921 |
suiteAndResult := SuiteAndResult |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
922 |
suite: (suite := self suiteForRun) |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
923 |
result: (self resultForSuite: suite). |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
924 |
self resultHolder value: suiteAndResult. |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
925 |
|
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
926 |
"Created: / 15-03-2010 / 19:41:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
927 |
"Modified: / 15-03-2010 / 20:55:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
928 |
"Modified: / 04-06-2012 / 19:03:15 / cg" |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
929 |
! |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
930 |
|
9954 | 931 |
updateTestCases |
11552 | 932 |
allTestCases := ((self selectedClassesHolder value ? #()) |
9954 | 933 |
select:[:cls | self isTestCaseLike:cls ]). |
11552 | 934 |
allTestCases := allTestCases asArray |
9954 | 935 |
|
936 |
"Created: / 11-03-2010 / 10:31:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11197 | 937 |
"Modified: / 24-01-2012 / 22:09:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11552 | 938 |
"Modified: / 04-06-2012 / 19:02:52 / cg" |
9954 | 939 |
! |
940 |
||
12309
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
941 |
updateTestSuiteAndResult |
9954 | 942 |
|
12309
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
943 |
| suite suiteAndResult | |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
944 |
self runningHolder value ifTrue:[^self]. |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
945 |
allTestCases isEmptyOrNil ifTrue:[^self]. |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
946 |
suiteAndResult := SuiteAndResult |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
947 |
suite: (suite := self suiteForRun) |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
948 |
result: (self resultForSuite: suite). |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
949 |
self resultHolder value: suiteAndResult. |
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
950 |
|
1dceb2eb9139
Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12308
diff
changeset
|
951 |
"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
|
952 |
"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
|
953 |
"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
|
954 |
! |
9954 | 955 |
|
956 |
updateVisibility |
|
957 |
||
958 |
self hasTestCaseSelected |
|
959 |
ifTrue:[self show] |
|
960 |
ifFalse:[self hide] |
|
961 |
||
962 |
"Created: / 11-03-2010 / 09:02:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
963 |
! ! |
|
964 |
||
965 |
!TestRunnerEmbedded methodsFor:'hooks'! |
|
966 |
||
10862 | 967 |
commonPostOpen |
968 |
||
969 |
Smalltalk addDependent: self. |
|
970 |
||
971 |
"Created: / 17-11-2011 / 20:59:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
972 |
! |
|
973 |
||
9954 | 974 |
postBuildRunnerPanel: aView |
975 |
||
976 |
runnerPanel := aView. |
|
977 |
runnerPanel backgroundColor: self resultBackgroundColorAspect value |
|
978 |
||
979 |
"Created: / 15-03-2010 / 14:26:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10862 | 980 |
! |
981 |
||
982 |
releaseAsSubCanvas |
|
983 |
||
984 |
Smalltalk removeDependent: self. |
|
985 |
||
986 |
"Created: / 17-11-2011 / 21:03:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
9954 | 987 |
! ! |
988 |
||
989 |
!TestRunnerEmbedded methodsFor:'private'! |
|
990 |
||
991 |
hide |
|
992 |
||
993 |
self visibility: false height: 0 |
|
994 |
||
995 |
"Created: / 11-03-2010 / 09:07:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
996 |
! |
|
997 |
||
998 |
isTestCaseLike:cls |
|
999 |
||
1000 |
^(super isTestCaseLike: cls) and: |
|
1001 |
[(cls askFor: #isAbstract) not] |
|
1002 |
||
1003 |
"Modified: / 04-03-2011 / 06:54:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1004 |
! |
|
1005 |
||
1006 |
show |
|
1007 |
||
1008 |
self visibility: true height: 50 |
|
1009 |
||
1010 |
"Created: / 11-03-2010 / 09:07:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1011 |
! |
|
1012 |
||
10564
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
1013 |
visibility:visibility height:height |
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
1014 |
|container list h| |
9954 | 1015 |
|
10564
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
1016 |
(container := self window container) ifNil:[ ^ self ]. |
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
1017 |
h := visibility ifFalse:[0] ifTrue:[ height ]. |
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
1018 |
container isVisible == visibility ifFalse:[ |
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
1019 |
container isVisible:visibility |
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
1020 |
]. |
9954 | 1021 |
list := container container subViews first. |
10564
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
1022 |
(list layout bottomOffset ~= height negated) ifTrue:[ |
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
1023 |
list layout:((list layout) |
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
1024 |
bottomOffset:height negated; |
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
1025 |
yourself) |
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
1026 |
]. |
9954 | 1027 |
|
1028 |
"Created: / 11-03-2010 / 09:51:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1029 |
! ! |
|
1030 |
||
1031 |
!TestRunnerEmbedded methodsFor:'queries'! |
|
1032 |
||
1033 |
hasTestCaseSelected |
|
1034 |
||
11966
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
1035 |
^self allTestCases notEmptyOrNil |
9954 | 1036 |
|
1037 |
"Created: / 11-03-2010 / 09:06:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1038 |
"Modified: / 15-03-2010 / 20:54:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10454 | 1039 |
"Modified: / 04-08-2011 / 20:42:10 / cg" |
9954 | 1040 |
! ! |
1041 |
||
1042 |
!TestRunnerEmbedded methodsFor:'utilities'! |
|
1043 |
||
10432 | 1044 |
resultForSuite:suite |
1045 |
|result| |
|
9954 | 1046 |
|
11925
7e2860fce495
use TestResultForSTX in SUnit runner
Claus Gittinger <cg@exept.de>
parents:
11600
diff
changeset
|
1047 |
result := TestResult defaultResultClass new. |
10432 | 1048 |
suite tests do:[:test | |
10606 | 1049 |
| sel cls | |
10432 | 1050 |
|
1051 |
sel := test selector. |
|
10606 | 1052 |
cls := test class. |
1053 |
(cls testSelectorPassed:sel) ifTrue:[ |
|
1054 |
result passedOutcomes add: (cls rememberedOutcomeFor: sel) |
|
10432 | 1055 |
] ifFalse:[ |
10606 | 1056 |
(cls testSelectorError:sel) ifTrue:[ |
1057 |
result errorOutcomes add:(cls rememberedOutcomeFor: sel) |
|
10432 | 1058 |
] ifFalse:[ |
10606 | 1059 |
(cls testSelectorFailed:sel) ifTrue:[ |
1060 |
result failureOutcomes add:(cls rememberedOutcomeFor: sel) |
|
10432 | 1061 |
] |
1062 |
] |
|
1063 |
] |
|
1064 |
]. |
|
1065 |
^ result |
|
9954 | 1066 |
|
1067 |
"Created: / 15-03-2010 / 19:46:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10432 | 1068 |
"Modified: / 02-08-2011 / 18:20:00 / cg" |
10606 | 1069 |
"Modified: / 20-08-2011 / 14:30:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9954 | 1070 |
! |
1071 |
||
1072 |
suiteForRun |
|
12303
b93ac7ba9280
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12262
diff
changeset
|
1073 |
| methods testMethods protocols suite selectedClass | |
10374 | 1074 |
|
1075 |
selectedClass := self theSingleTestCase. |
|
11966
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
1076 |
|
10563
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1077 |
(methods := selectedMethodsHolder value) notEmptyOrNil ifTrue:[ |
12303
b93ac7ba9280
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12262
diff
changeset
|
1078 |
testMethods := self selectedTestMethods. |
b93ac7ba9280
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12262
diff
changeset
|
1079 |
suite := TestSuite named: (self suiteNameFromMethods: testMethods). |
b93ac7ba9280
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12262
diff
changeset
|
1080 |
testMethods do:[:mthd| |
10563
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1081 |
| class selector | |
10374 | 1082 |
class := selectedClass ifNil:[mthd mclass]. |
10563
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1083 |
suite addTest: (class asTestCase selector: mthd selector) |
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1084 |
]. |
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1085 |
^suite |
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1086 |
]. |
9954 | 1087 |
|
10563
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1088 |
(protocols := selectedProtocolsHolder value) isEmptyOrNil ifFalse:[ |
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1089 |
suite := TestSuite named: (self suiteNameFromProtocols: protocols). |
11966
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
1090 |
(self selectedTestMethodsFromProtocols: protocols inClass:selectedClass) do:[:mthd| |
10563
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1091 |
| class selector | |
10374 | 1092 |
class := selectedClass ifNil:[mthd mclass]. |
10563
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1093 |
suite addTest: (mthd mclass asTestCase selector: mthd selector) |
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1094 |
]. |
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1095 |
^suite |
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1096 |
]. |
10374 | 1097 |
|
9954 | 1098 |
^self suiteForRunAll |
1099 |
||
1100 |
"Created: / 15-03-2010 / 13:13:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10454 | 1101 |
"Modified: / 04-08-2011 / 19:06:42 / cg" |
12303
b93ac7ba9280
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12262
diff
changeset
|
1102 |
"Modified: / 02-11-2012 / 11:17:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9954 | 1103 |
! |
1104 |
||
1105 |
suiteForRunAll |
|
1106 |
|suite| |
|
11966
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
1107 |
|
11552 | 1108 |
allTestCases isNil ifTrue:[ |
1109 |
self updateTestCases. |
|
1110 |
]. |
|
11966
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
1111 |
suite := TestSuite named:(self suiteNameFromClasses: self allTestCases). |
11552 | 1112 |
|
1113 |
allTestCases do:[:testCase | |
|
10563
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1114 |
suite addTests:(self buildSuiteFromClass:testCase) tests |
f77d63752e6a
comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents:
10454
diff
changeset
|
1115 |
]. |
9954 | 1116 |
^suite |
1117 |
||
1118 |
"Modified: / 04-03-2011 / 06:57:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11552 | 1119 |
"Modified: / 04-06-2012 / 19:01:48 / cg" |
1120 |
! |
|
1121 |
||
1122 |
suiteForRunFailed |
|
1123 |
|suite| |
|
1124 |
||
11966
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
1125 |
suite := TestSuite named:(self suiteNameFromClasses: self allTestCases). |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
1126 |
self allTestCases do:[:testCase | |
11552 | 1127 |
(self buildSuiteFromClass:testCase) tests do:[:eachTest | |
1128 |
| sel cls | |
|
1129 |
||
1130 |
sel := eachTest selector. |
|
1131 |
cls := eachTest class. |
|
1132 |
(cls testSelectorPassed:sel) ifFalse:[ |
|
1133 |
suite addTest:eachTest |
|
1134 |
] |
|
1135 |
] |
|
1136 |
]. |
|
1137 |
^suite |
|
1138 |
||
1139 |
"Modified: / 04-03-2011 / 06:57:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1140 |
"Created: / 04-06-2012 / 18:32:40 / cg" |
|
9954 | 1141 |
! ! |
1142 |
||
1143 |
!TestRunnerEmbedded::SuiteAndResult class methodsFor:'instance creation'! |
|
1144 |
||
1145 |
suite: suite result: result |
|
1146 |
||
1147 |
^self new |
|
1148 |
suite: suite; |
|
1149 |
result: result. |
|
1150 |
||
1151 |
"Modified: / 15-03-2010 / 15:27:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1152 |
! ! |
|
1153 |
||
1154 |
!TestRunnerEmbedded::SuiteAndResult methodsFor:'accessing'! |
|
1155 |
||
1156 |
color |
|
1157 |
||
1158 |
self testCount == 0 ifTrue: |
|
1159 |
[^TestRunnerEmbedded notRunColor]. |
|
1160 |
||
1161 |
result ifNil:[^TestRunnerEmbedded notRunColor]. |
|
1162 |
self hasErrors ifTrue:[^TestRunnerEmbedded errorColor]. |
|
1163 |
self hasFailures ifTrue:[^TestRunnerEmbedded failedColor]. |
|
1164 |
self hasPassed ifTrue:[^TestRunnerEmbedded passedColor]. |
|
1165 |
^TestRunnerEmbedded notRunColor |
|
1166 |
||
1167 |
"Created: / 15-03-2010 / 15:24:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1168 |
"Modified: / 07-09-2010 / 08:25:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1169 |
! |
|
1170 |
||
1171 |
info |
|
1172 |
||
1173 |
result ifNil:[^'']. |
|
1174 |
(result passedCount + result failureCount + result errorCount) = 1 ifTrue:[^'']. |
|
1175 |
^'%1 tests, %2 passed, %3 failed, %4 errors' |
|
1176 |
bindWith: suite tests size |
|
1177 |
with: result passedCount |
|
1178 |
with: result failureCount |
|
1179 |
with: result errorCount |
|
1180 |
||
1181 |
"Created: / 15-03-2010 / 20:23:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1182 |
! |
|
1183 |
||
1184 |
name |
|
1185 |
||
1186 |
^suite name |
|
1187 |
||
1188 |
"Created: / 15-03-2010 / 15:12:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1189 |
! |
|
1190 |
||
1191 |
result |
|
1192 |
^ result |
|
1193 |
! |
|
1194 |
||
1195 |
result:aTestResult |
|
1196 |
result := aTestResult. |
|
1197 |
! |
|
1198 |
||
1199 |
suite |
|
1200 |
^ suite |
|
1201 |
! |
|
1202 |
||
1203 |
suite:aTestSuite |
|
1204 |
suite := aTestSuite. |
|
1205 |
! |
|
1206 |
||
10647
1e9912f9a0d8
Embedded test runner no longer reuse old testcase instances
vrany
parents:
10608
diff
changeset
|
1207 |
suiteForRun |
1e9912f9a0d8
Embedded test runner no longer reuse old testcase instances
vrany
parents:
10608
diff
changeset
|
1208 |
|
1e9912f9a0d8
Embedded test runner no longer reuse old testcase instances
vrany
parents:
10608
diff
changeset
|
1209 |
| suiteForRun | |
1e9912f9a0d8
Embedded test runner no longer reuse old testcase instances
vrany
parents:
10608
diff
changeset
|
1210 |
suiteForRun := suite class named: suite name. |
1e9912f9a0d8
Embedded test runner no longer reuse old testcase instances
vrany
parents:
10608
diff
changeset
|
1211 |
suiteForRun addTests: |
1e9912f9a0d8
Embedded test runner no longer reuse old testcase instances
vrany
parents:
10608
diff
changeset
|
1212 |
(suite tests collect:[:testCase|testCase class selector: testCase selector]). |
1e9912f9a0d8
Embedded test runner no longer reuse old testcase instances
vrany
parents:
10608
diff
changeset
|
1213 |
^suiteForRun |
1e9912f9a0d8
Embedded test runner no longer reuse old testcase instances
vrany
parents:
10608
diff
changeset
|
1214 |
|
1e9912f9a0d8
Embedded test runner no longer reuse old testcase instances
vrany
parents:
10608
diff
changeset
|
1215 |
"Created: / 22-08-2011 / 09:56:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1e9912f9a0d8
Embedded test runner no longer reuse old testcase instances
vrany
parents:
10608
diff
changeset
|
1216 |
! |
1e9912f9a0d8
Embedded test runner no longer reuse old testcase instances
vrany
parents:
10608
diff
changeset
|
1217 |
|
9954 | 1218 |
testCount |
1219 |
||
1220 |
^suite tests size |
|
1221 |
||
1222 |
"Created: / 15-03-2010 / 15:44:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1223 |
! ! |
|
1224 |
||
1225 |
!TestRunnerEmbedded::SuiteAndResult methodsFor:'queries'! |
|
1226 |
||
1227 |
hasErrors |
|
1228 |
||
1229 |
^result errorCount > 0 |
|
1230 |
||
1231 |
"Created: / 15-03-2010 / 15:21:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1232 |
! |
|
1233 |
||
1234 |
hasFailures |
|
1235 |
||
1236 |
^result failureCount > 0 |
|
1237 |
||
1238 |
"Created: / 15-03-2010 / 15:21:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1239 |
! |
|
1240 |
||
1241 |
hasFailuresOrErrors |
|
1242 |
||
1243 |
^self hasErrors or:[self hasFailures] |
|
1244 |
||
1245 |
"Created: / 15-03-2010 / 15:45:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1246 |
! |
|
1247 |
||
1248 |
hasPassed |
|
1249 |
||
1250 |
^result passedCount > 0 |
|
1251 |
||
1252 |
"Created: / 15-03-2010 / 22:06:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1253 |
! ! |
|
1254 |
||
1255 |
!TestRunnerEmbedded class methodsFor:'documentation'! |
|
1256 |
||
10432 | 1257 |
version |
12310
bdd2106c15f5
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12309
diff
changeset
|
1258 |
^ '$Id: Tools__TestRunnerEmbedded.st 8076 2012-12-03 16:22:00Z vranyj1 $' |
10432 | 1259 |
! |
1260 |
||
9954 | 1261 |
version_CVS |
12308 | 1262 |
^ '§Header: /cvs/stx/stx/libtool/Tools__TestRunnerEmbedded.st,v 1.32 2012/11/08 00:05:16 cg Exp §' |
9954 | 1263 |
! |
1264 |
||
12431
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
1265 |
version_HG |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
1266 |
|
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
1267 |
^ '$Changeset: <not expanded> $' |
9954 | 1268 |
! |
1269 |
||
1270 |
version_SVN |
|
12310
bdd2106c15f5
- Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12309
diff
changeset
|
1271 |
^ '$Id: Tools__TestRunnerEmbedded.st 8076 2012-12-03 16:22:00Z vranyj1 $' |
9954 | 1272 |
! ! |
12604
8d8912ec9551
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
12055
diff
changeset
|
1273 |