author | sr |
Tue, 03 Dec 2019 11:47:02 +0100 | |
changeset 766 | 9fbada22f0db |
parent 765 | 25cfb3b6f834 |
permissions | -rw-r--r-- |
763 | 1 |
"{ Encoding: utf8 }" |
2 |
||
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
3 |
"{ Package: 'stx:goodies/sunit' }" |
0 | 4 |
|
599 | 5 |
"{ NameSpace: Smalltalk }" |
6 |
||
222 | 7 |
TestAsserter subclass:#TestCase |
377 | 8 |
instanceVariableNames:'testSelector' |
9 |
classVariableNames:'' |
|
10 |
poolDictionaries:'' |
|
11 |
category:'SUnit-Base' |
|
0 | 12 |
! |
13 |
||
382 | 14 |
TestCase class instanceVariableNames:'lastOutcomes' |
81 | 15 |
|
16 |
" |
|
17 |
No other class instance variables are inherited by this class. |
|
18 |
" |
|
19 |
! |
|
20 |
||
717 | 21 |
Object subclass:#Should |
719 | 22 |
instanceVariableNames:'assertSelector shouldNot value testCase' |
717 | 23 |
classVariableNames:'' |
24 |
poolDictionaries:'' |
|
25 |
privateIn:TestCase |
|
26 |
! |
|
27 |
||
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
28 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
29 |
!TestCase class methodsFor:'initialization'! |
12 | 30 |
|
435 | 31 |
flushAll |
32 |
||
33 |
"Flush all remembered outcomes in all testcases" |
|
34 |
||
35 |
self withAllSubclassesDo:[:cls| |
|
594 | 36 |
cls flushRememberedOutcomes |
435 | 37 |
] |
38 |
||
39 |
"Created: / 17-11-2011 / 19:18:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
40 |
! |
|
41 |
||
42 |
flushRememberedOutcomes |
|
43 |
||
44 |
"Flushes all remembered outcomes for the receiver" |
|
45 |
||
46 |
| outcomes | |
|
47 |
||
48 |
lastOutcomes isNil ifTrue:[^self]. |
|
594 | 49 |
outcomes := lastOutcomes. |
435 | 50 |
lastOutcomes := nil. |
51 |
outcomes do:[:outcome| |
|
594 | 52 |
self lastTestRunResultChanged: outcome selector. |
435 | 53 |
] |
54 |
||
55 |
"Created: / 17-11-2011 / 19:17:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
56 |
! |
|
57 |
||
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
58 |
initialize |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
59 |
ResumableTestFailure autoload |
138 | 60 |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
61 |
" |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
62 |
self initialize |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
63 |
" |
326 | 64 |
! |
65 |
||
66 |
postAutoload |
|
433 | 67 |
|pd| |
68 |
||
69 |
(pd := self projectDefinitionClass) notNil ifTrue:[ |
|
594 | 70 |
pd loadExtensions |
433 | 71 |
] |
72 |
||
73 |
"Modified: / 02-11-2011 / 15:44:58 / sr" |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
74 |
! ! |
138 | 75 |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
76 |
!TestCase class methodsFor:'instance creation'! |
2 | 77 |
|
288 | 78 |
asTestCase |
79 |
^ self |
|
80 |
||
81 |
"Created: / 02-08-2011 / 09:12:13 / cg" |
|
82 |
! |
|
83 |
||
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
84 |
debug: aSymbol |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
85 |
|
594 | 86 |
^(self selector: aSymbol) debug |
138 | 87 |
! |
2 | 88 |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
89 |
run: aSymbol |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
90 |
|
594 | 91 |
^(self selector: aSymbol) run |
138 | 92 |
! |
93 |
||
0 | 94 |
selector: aSymbol |
103 | 95 |
|
594 | 96 |
^self new setTestSelector: aSymbol |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
97 |
! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
98 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
99 |
suite |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
100 |
|
594 | 101 |
^self buildSuite |
0 | 102 |
! ! |
103 |
||
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
104 |
!TestCase class methodsFor:'accessing'! |
66 | 105 |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
106 |
allTestSelectors |
328
66cae160c956
added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
107 |
| answer pivotClass lookupRoot | |
66cae160c956
added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
108 |
|
66cae160c956
added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
109 |
answer := Set withAll: self testSelectors. |
66cae160c956
added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
110 |
self shouldInheritSelectors ifTrue:[ |
669 | 111 |
pivotClass := self superclass. |
112 |
lookupRoot := self lookupHierarchyRoot. |
|
113 |
[pivotClass == lookupRoot] whileFalse:[ |
|
114 |
answer addAll: pivotClass testSelectors. |
|
115 |
pivotClass := pivotClass superclass. |
|
116 |
] |
|
328
66cae160c956
added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
117 |
]. |
669 | 118 |
answer := answer asOrderedCollection. |
119 |
answer sort. |
|
120 |
^ answer |
|
420 | 121 |
|
421 | 122 |
"Modified: / 21-08-2011 / 15:06:11 / cg" |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
123 |
! |
66 | 124 |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
125 |
forgetLastTestRunResult |
390 | 126 |
|
127 |
Smalltalk changed:#lastTestRunResult with:(Array with:self with:nil). |
|
128 |
self changed:#lastTestRunResult. |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
129 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
130 |
"Modified: / 06-08-2006 / 11:40:07 / cg" |
390 | 131 |
"Modified: / 20-08-2011 / 15:10:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
132 |
! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
133 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
134 |
isTestSelector:aSelector |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
135 |
|
705 | 136 |
^aSelector notNil |
137 |
and:[(aSelector startsWith:'test') |
|
138 |
"/ temporary hack - the callers of testCount should use countTests instead |
|
139 |
and:[aSelector ~= 'testCount']] |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
140 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
141 |
"Created: / 06-08-2006 / 11:46:17 / cg" |
222 | 142 |
"Modified: / 05-12-2009 / 18:50:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
290 | 143 |
"Modified: / 02-08-2011 / 17:46:51 / cg" |
222 | 144 |
! |
145 |
||
382 | 146 |
lastTestRunResultOrNil |
578 | 147 |
"Returns a state (TestResult stateXXX), depending |
148 |
on the state of the tests: |
|
594 | 149 |
statePass if all tests passed, |
150 |
stateError if any error, |
|
151 |
stateFail if any fail, |
|
152 |
or nil if never run |
|
578 | 153 |
" |
222 | 154 |
|
578 | 155 |
|anyFail| |
156 |
||
382 | 157 |
lastOutcomes isNil ifTrue:[^nil]. |
158 |
lastOutcomes size ~= self testSelectors size ifTrue:[^nil]. |
|
578 | 159 |
anyFail := false. |
160 |
||
382 | 161 |
lastOutcomes do:[:outcome| |
594 | 162 |
outcome result == (TestResult stateError) ifTrue:[ |
163 |
^ TestResult stateError |
|
164 |
]. |
|
165 |
outcome result == (TestResult stateFail) ifTrue:[ |
|
166 |
anyFail := true |
|
167 |
]. |
|
382 | 168 |
]. |
578 | 169 |
anyFail ifTrue:[ ^ TestResult stateFail ]. |
170 |
^ TestResult statePass |
|
222 | 171 |
|
382 | 172 |
"Modified: / 20-08-2011 / 14:59:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
173 |
! |
87
24e88e7f5d88
remember individual failed cases.
Claus Gittinger <cg@exept.de>
parents:
82
diff
changeset
|
174 |
|
222 | 175 |
lookupHierarchyRoot |
594 | 176 |
^TestCase |
222 | 177 |
! |
178 |
||
523 | 179 |
rememberOutcome: thisOutcome |
626 | 180 |
|thisTestCase someOtherOutcome someOtherTestCase |
181 |
thisTestCaseSelector thisTestCaseClassName| |
|
523 | 182 |
|
183 |
thisTestCase := thisOutcome testCase. |
|
626 | 184 |
thisTestCaseSelector := thisTestCase selector. |
185 |
thisTestCaseClassName := thisTestCase class name. |
|
186 |
||
382 | 187 |
lastOutcomes isNil ifTrue:[ |
626 | 188 |
lastOutcomes := OrderedCollection new. |
382 | 189 |
]. |
445 | 190 |
|
523 | 191 |
"Not a nice code, but portable (what: doWithIndex: is not portable?)" |
382 | 192 |
1 to: lastOutcomes size do:[:i| |
626 | 193 |
someOtherOutcome := lastOutcomes at: i. |
194 |
someOtherTestCase := someOtherOutcome testCase. |
|
195 |
"/ compare by classes name - in case it got redefined |
|
196 |
(someOtherTestCase selector == thisTestCaseSelector |
|
197 |
and: [someOtherTestCase class name = thisTestCaseClassName]) ifTrue:[ |
|
198 |
"remember; for the timestamp and other info" |
|
199 |
lastOutcomes at: i put: thisOutcome. |
|
200 |
someOtherOutcome result ~= thisOutcome result ifTrue:[ |
|
201 |
"but only send out change notification to browser if state has changed" |
|
202 |
self lastTestRunResultChanged: thisOutcome selector. |
|
203 |
]. |
|
204 |
^self. |
|
205 |
]. |
|
222 | 206 |
]. |
523 | 207 |
lastOutcomes add: thisOutcome. |
208 |
self lastTestRunResultChanged: thisOutcome selector. |
|
382 | 209 |
^self |
222 | 210 |
|
382 | 211 |
"Created: / 20-08-2011 / 12:43:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
445 | 212 |
"Modified: / 04-06-2012 / 16:19:07 / cg" |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
213 |
! |
81 | 214 |
|
382 | 215 |
rememberedOutcomeFor: selector |
222 | 216 |
|
382 | 217 |
lastOutcomes isNil ifTrue:[^nil]. |
594 | 218 |
^lastOutcomes |
219 |
detect: [:outcome| outcome testCase selector == selector] |
|
220 |
ifNone:[nil]. |
|
87
24e88e7f5d88
remember individual failed cases.
Claus Gittinger <cg@exept.de>
parents:
82
diff
changeset
|
221 |
|
382 | 222 |
"Created: / 20-08-2011 / 14:27:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
223 |
! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
224 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
225 |
resources |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
226 |
|
594 | 227 |
^#() |
222 | 228 |
! |
229 |
||
230 |
shouldFork |
|
231 |
||
232 |
^false |
|
233 |
||
234 |
"Created: / 13-06-2011 / 16:46:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
103 | 235 |
! |
236 |
||
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
237 |
sunitVersion |
594 | 238 |
^'4.0' |
222 | 239 |
! |
240 |
||
391 | 241 |
testSelector:selector result: result |
523 | 242 |
"return true, if the last run of this test had the outcome result" |
382 | 243 |
|
244 |
lastOutcomes isNil ifTrue:[^false]. |
|
594 | 245 |
^ lastOutcomes |
607 | 246 |
contains:[:any| |
247 |
|tc| |
|
248 |
||
249 |
(tc := any testCase) class name = self name |
|
250 |
and:[tc selector == selector |
|
251 |
and:[any result == result]] |
|
252 |
] |
|
391 | 253 |
|
254 |
"Created: / 20-08-2011 / 16:15:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
445 | 255 |
"Modified: / 04-06-2012 / 16:12:17 / cg" |
391 | 256 |
! |
257 |
||
258 |
testSelectorError:selector |
|
523 | 259 |
"return true, if the last run of this test failed" |
391 | 260 |
|
523 | 261 |
^self testSelector: selector result: (TestResult stateError) |
222 | 262 |
|
263 |
"Created: / 15-03-2010 / 19:44:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
264 |
! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
265 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
266 |
testSelectorFailed:selector |
523 | 267 |
"return true, if the last run of this test failed" |
222 | 268 |
|
523 | 269 |
^self testSelector: selector result: (TestResult stateFail) |
382 | 270 |
|
391 | 271 |
"Modified: / 20-08-2011 / 16:16:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
272 |
! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
273 |
|
222 | 274 |
testSelectorPassed:selector |
523 | 275 |
"return true, if the last run of this test passed" |
382 | 276 |
|
523 | 277 |
^self testSelector: selector result: (TestResult statePass) |
278 |
||
279 |
"Created: / 15-03-2010 / 17:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
280 |
! |
|
281 |
||
282 |
testSelectorSkipped:selector |
|
283 |
"return true, if the last run of this test was skipped" |
|
284 |
||
285 |
^self testSelector: selector result: (TestResult stateSkip) |
|
211
3a40b828ce9a
comment/format in: #testSelectors
Claus Gittinger <cg@exept.de>
parents:
209
diff
changeset
|
286 |
|
222 | 287 |
"Created: / 15-03-2010 / 17:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
607 | 288 |
! |
289 |
||
290 |
testSelectorsWithLastOutcomes |
|
291 |
lastOutcomes isNil ifTrue:[^#()]. |
|
292 |
^lastOutcomes collect:[:outcome| outcome testCase selector] as:Set |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
293 |
! ! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
294 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
295 |
!TestCase class methodsFor:'building suites'! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
296 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
297 |
buildSuite |
594 | 298 |
| suite | |
299 |
self isAbstract |
|
300 |
ifTrue: |
|
301 |
[suite := self suiteClass named: self name asString. |
|
302 |
self allSubclasses |
|
303 |
do: [:each | each isAbstract ifFalse: [suite addTest: each buildSuiteFromSelectors]]. |
|
304 |
^ suite] |
|
305 |
ifFalse: [^ self buildSuiteFromSelectors] |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
306 |
! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
307 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
308 |
buildSuiteFromMethods: testMethods |
68 | 309 |
|
594 | 310 |
^testMethods |
311 |
inject: (self suiteClass named: self name asString) |
|
312 |
into: [:suite :selector | |
|
313 |
suite |
|
314 |
addTest: (self selector: selector); |
|
315 |
yourself] |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
316 |
! |
138 | 317 |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
318 |
buildSuiteFromSelectors |
594 | 319 |
^self buildSuiteFromMethods: self allTestSelectors |
68 | 320 |
! |
321 |
||
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
322 |
suiteClass |
594 | 323 |
^TestSuite |
68 | 324 |
! ! |
325 |
||
203 | 326 |
!TestCase class methodsFor:'misc ui support'! |
327 |
||
328 |
iconInBrowserSymbol |
|
630
5b0539adf1c1
comment/format in: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents:
628
diff
changeset
|
329 |
"the browser will use this as index into the toolbariconlibrary" |
5b0539adf1c1
comment/format in: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents:
628
diff
changeset
|
330 |
|
203 | 331 |
<resource: #programImage> |
332 |
||
205 | 333 |
|lastResult| |
334 |
||
203 | 335 |
self theNonMetaclass isAbstract ifTrue:[^ super iconInBrowserSymbol]. |
205 | 336 |
|
337 |
lastResult := self lastTestRunResultOrNil. |
|
578 | 338 |
lastResult notNil ifTrue:[ |
630
5b0539adf1c1
comment/format in: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents:
628
diff
changeset
|
339 |
lastResult == TestResult statePass ifTrue:[ |
5b0539adf1c1
comment/format in: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents:
628
diff
changeset
|
340 |
^ #testCasePassedIcon |
5b0539adf1c1
comment/format in: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents:
628
diff
changeset
|
341 |
]. |
5b0539adf1c1
comment/format in: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents:
628
diff
changeset
|
342 |
lastResult == TestResult stateFail ifTrue:[ |
5b0539adf1c1
comment/format in: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents:
628
diff
changeset
|
343 |
^ #testCaseFailedIcon |
5b0539adf1c1
comment/format in: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents:
628
diff
changeset
|
344 |
]. |
5b0539adf1c1
comment/format in: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents:
628
diff
changeset
|
345 |
lastResult == TestResult stateError ifTrue:[ |
5b0539adf1c1
comment/format in: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents:
628
diff
changeset
|
346 |
^ #testCaseErrorIcon |
5b0539adf1c1
comment/format in: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents:
628
diff
changeset
|
347 |
]. |
205 | 348 |
]. |
203 | 349 |
^ #testCaseClassIcon |
350 |
! ! |
|
351 |
||
222 | 352 |
!TestCase class methodsFor:'private'! |
353 |
||
354 |
addSelector: selector to: collection |
|
355 |
||
356 |
"Adds given selector from collection. Answers |
|
357 |
true iff selector was really added" |
|
358 |
||
594 | 359 |
(collection includes: selector) |
360 |
ifTrue:[^ false] |
|
361 |
ifFalse:[collection add: selector. ^ true] |
|
222 | 362 |
|
363 |
"Created: / 15-03-2010 / 18:06:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
364 |
"Modified: / 21-04-2010 / 23:19:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
365 |
! |
|
366 |
||
689 | 367 |
coveredClasses |
368 |
"return a collection of classes which are tested by this suite/case. |
|
369 |
Do not redefine this; redefine either coveredClassNames or |
|
370 |
coveredPackageNames |
|
371 |
(these return names, to avoid creating |
|
372 |
a package dependecy due to the class references) |
|
373 |
||
374 |
These classes can be instrumented for coverage analysis, |
|
375 |
before running the suite to provide coverage analysis/report" |
|
376 |
||
377 |
|names| |
|
378 |
||
379 |
(names := self coveredPackageNames) notEmptyOrNil ifTrue:[ |
|
380 |
^ names |
|
381 |
collectAll:[:eachPackageOrPattern | |
|
382 |
eachPackageOrPattern includesMatchCharacters ifTrue:[ |
|
383 |
Smalltalk allClassesForWhich:[:cls | (cls package ?'') matches:eachPackageOrPattern]. |
|
384 |
] ifFalse:[ |
|
385 |
Smalltalk allClassesInPackage:eachPackageOrPattern |
|
386 |
] |
|
387 |
]. |
|
388 |
]. |
|
389 |
^ self coveredClassNames collect:[:each | Smalltalk classNamed:each] |
|
390 |
||
391 |
"Modified (comment): / 30-08-2017 / 11:09:22 / cg" |
|
749 | 392 |
"Modified: / 29-05-2019 / 01:30:01 / Claus Gittinger" |
689 | 393 |
! |
394 |
||
222 | 395 |
lastTestRunResultChanged: selector |
396 |
||
397 |
Smalltalk changed:#lastTestRunResult with:(Array with:self with:selector). |
|
398 |
self changed:#lastTestRunResult with:selector. |
|
399 |
||
400 |
"Created: / 15-03-2010 / 19:15:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
401 |
! |
|
402 |
||
403 |
testSelectors |
|
669 | 404 |
"The API method is allTestSelectors which now includes #shouldInheritSelectors and so handles all cases. Unlike that method, this does not guarantee to return a sorted ordered collection." |
222 | 405 |
|
669 | 406 |
|selectors| |
407 |
||
408 |
selectors := self sunitSelectors |
|
409 |
select: [:each | 'test*' sunitMatch: each]. |
|
410 |
selectors := selectors asOrderedCollection. |
|
411 |
selectors sort. |
|
412 |
^ selectors |
|
222 | 413 |
! ! |
414 |
||
417 | 415 |
!TestCase class methodsFor:'queries'! |
416 |
||
417 |
coveredClassNames |
|
749 | 418 |
"should be redefined to return a collection of class names |
419 |
which are tested by this suite/case. |
|
600 | 420 |
If not redefined, coveredPackageNames should be. |
599 | 421 |
|
422 |
These classes can be instrumented for coverage analysis, |
|
600 | 423 |
before running the suite to provide coverage analysis/report" |
417 | 424 |
|
425 |
^ #() |
|
426 |
||
427 |
"Created: / 06-07-2011 / 21:27:03 / cg" |
|
749 | 428 |
"Modified (comment): / 29-05-2019 / 01:32:23 / Claus Gittinger" |
417 | 429 |
! |
430 |
||
599 | 431 |
coveredPackageNames |
432 |
"redefine this in a concrete testCase class to return non-nil, |
|
433 |
to return a collection of packages which are tested by this suite/case. |
|
434 |
If not redefined, coveredClassNames should be redefined. |
|
624 | 435 |
The package names may be glob patterns. |
599 | 436 |
These classes can be instrumented for coverage analysis, |
600 | 437 |
before running the suite to provide coverage analysis/report" |
599 | 438 |
|
439 |
^ nil |
|
636 | 440 |
! |
441 |
||
764 | 442 |
doRunExpeccoRelatedUnitTestsOnly |
443 |
" |
|
444 |
self doRunExpeccoRelatedUnitTestsOnly |
|
445 |
" |
|
446 |
||
447 |
|runUnitTestsClass| |
|
448 |
||
449 |
runUnitTestsClass := Smalltalk at:#RunUnitTests. |
|
450 |
runUnitTestsClass isNil ifTrue:[ |
|
451 |
^ false |
|
452 |
]. |
|
453 |
||
454 |
^ runUnitTestsClass doRunExpeccoRelatedUnitTestsOnly |
|
455 |
||
456 |
"Created: / 03-12-2019 / 11:03:06 / Stefan Reise" |
|
457 |
! |
|
458 |
||
636 | 459 |
isAbstract |
460 |
"Override to true if a TestCase subclass is Abstract and should not have |
|
461 |
TestCase instances built from it" |
|
462 |
||
463 |
^self == TestCase |
|
749 | 464 |
! |
465 |
||
766 | 466 |
isCompiledWithBorland32 |
765 | 467 |
" |
766 | 468 |
self isCompiledWithBorland32 |
765 | 469 |
" |
470 |
||
471 |
^ OperatingSystem isMSWINDOWSlike |
|
472 |
and:[ExternalAddress pointerSize == 4] |
|
473 |
||
766 | 474 |
"Created: / 03-12-2019 / 11:46:31 / Stefan Reise" |
765 | 475 |
! |
476 |
||
766 | 477 |
isCompiledWithGcc32 |
765 | 478 |
" |
766 | 479 |
self isCompiledWithGcc32 |
765 | 480 |
" |
481 |
||
482 |
^ OperatingSystem isMSWINDOWSlike not |
|
483 |
and:[ExternalAddress pointerSize == 4] |
|
484 |
||
766 | 485 |
"Created: / 03-12-2019 / 11:46:28 / Stefan Reise" |
765 | 486 |
! |
487 |
||
766 | 488 |
isCompiledWithGcc64 |
765 | 489 |
" |
766 | 490 |
self isCompiledWithGcc64 |
765 | 491 |
" |
492 |
||
493 |
^ OperatingSystem isMSWINDOWSlike not |
|
494 |
and:[ExternalAddress pointerSize == 8] |
|
495 |
||
766 | 496 |
"Created: / 03-12-2019 / 11:46:42 / Stefan Reise" |
765 | 497 |
! |
498 |
||
766 | 499 |
isCompiledWithMingw64 |
765 | 500 |
" |
766 | 501 |
self isCompiledWithMingw64 |
765 | 502 |
" |
503 |
||
504 |
^ OperatingSystem isMSWINDOWSlike |
|
505 |
and:[ExternalAddress pointerSize == 8] |
|
506 |
||
766 | 507 |
"Created: / 03-12-2019 / 11:46:46 / Stefan Reise" |
765 | 508 |
! |
509 |
||
749 | 510 |
requiredPackageNames |
511 |
"can be redefined to return a collection of packages |
|
512 |
which are required to be present when running tests. |
|
513 |
If not redefined, coveredPackageNames is used." |
|
514 |
||
515 |
^ nil |
|
516 |
||
517 |
"Created: / 29-05-2019 / 01:31:59 / Claus Gittinger" |
|
417 | 518 |
! ! |
519 |
||
197 | 520 |
!TestCase class methodsFor:'quick testing'! |
521 |
||
686 | 522 |
assert: aBooleanOrBlock |
707 | 523 |
<resource: #skipInDebuggersWalkBack> |
524 |
||
686 | 525 |
^ self new assert: aBooleanOrBlock |
197 | 526 |
|
527 |
" |
|
528 |
TestCase assert: true |
|
529 |
" |
|
686 | 530 |
|
531 |
"Modified (format): / 13-07-2017 / 15:13:29 / cg" |
|
197 | 532 |
! |
533 |
||
534 |
should: aBlock raise: anError |
|
707 | 535 |
<resource: #skipInDebuggersWalkBack> |
536 |
||
197 | 537 |
^ self new should: aBlock raise: anError |
538 |
||
539 |
" |
|
540 |
TestCase should:[ self error ] raise: Error |
|
587 | 541 |
TestCase should:[ 22 ] raise: Error |
197 | 542 |
" |
543 |
! ! |
|
544 |
||
601 | 545 |
!TestCase class methodsFor:'running'! |
546 |
||
700 | 547 |
debug |
548 |
"run myself as a suite with debugging; return the result" |
|
549 |
||
550 |
^ self suite debug |
|
551 |
||
552 |
" |
|
553 |
SOAP::XeXMLTests run |
|
554 |
RegressionTests::OperatingSystemTest run |
|
555 |
" |
|
556 |
! |
|
557 |
||
601 | 558 |
run |
688 | 559 |
"run myself as a suite; return the result" |
560 |
||
561 |
^ self suite run |
|
601 | 562 |
|
563 |
" |
|
564 |
SOAP::XeXMLTests run |
|
688 | 565 |
RegressionTests::OperatingSystemTest run |
601 | 566 |
" |
567 |
! ! |
|
568 |
||
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
569 |
!TestCase class methodsFor:'testing'! |
103 | 570 |
|
222 | 571 |
isTestCaseLike |
572 |
||
573 |
^true |
|
574 |
||
575 |
"Created: / 06-03-2011 / 00:16:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
576 |
! |
103 | 577 |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
578 |
rememberResult:result |
382 | 579 |
|
580 |
result outcomesDo:[:outcome|self rememberOutcome: outcome]. |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
581 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
582 |
"Created: / 05-08-2006 / 12:33:08 / cg" |
382 | 583 |
"Modified: / 20-08-2011 / 14:02:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
584 |
! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
585 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
586 |
runTests |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
587 |
|
391 | 588 |
^self suite run |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
589 |
|
265
125e4f132d46
remember execution time (needed to generate prober reports)
Claus Gittinger <cg@exept.de>
parents:
262
diff
changeset
|
590 |
"Modified: / 30-07-2011 / 09:26:11 / cg" |
391 | 591 |
"Modified: / 20-08-2011 / 16:14:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
592 |
! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
593 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
594 |
shouldInheritSelectors |
710 | 595 |
"I should inherit from an Abstract superclass but not from a concrete one by default, |
596 |
unless I have no testSelectors in which case I must be expecting to inherit them from my superclass. |
|
597 |
If a test case with selectors wants to inherit selectors from a concrete superclass, |
|
598 |
override this to true in that subclass." |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
599 |
|
710 | 600 |
^self ~~ self lookupHierarchyRoot |
601 |
and: [self superclass isAbstract |
|
602 |
or: [self testSelectors isEmpty]] |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
603 |
! ! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
604 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
605 |
!TestCase methodsFor:'accessing'! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
606 |
|
700 | 607 |
countTests |
608 |
||
609 |
^1 |
|
610 |
||
611 |
"Created: / 04-08-2011 / 13:03:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
612 |
! |
|
613 |
||
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
614 |
resources |
594 | 615 |
"We give TestCase this instance-side method so that methods polymorphic with TestSuite can be code-identical. Having this instance-side method also helps when writing tests of resource behaviour. Except for such tests, it is rare to override this method and should not be done without thought. If there were a good reason why a single test case needed to share tests requiring different resources, it might be legitimate." |
222 | 616 |
|
594 | 617 |
^self class resources |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
618 |
! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
619 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
620 |
selector |
594 | 621 |
^testSelector |
222 | 622 |
! |
623 |
||
624 |
shouldFork |
|
625 |
||
626 |
^self class shouldFork |
|
627 |
||
628 |
"Created: / 13-06-2011 / 16:45:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
305 | 629 |
! |
630 |
||
529 | 631 |
shouldSkip |
632 |
"Returns true, if this testcase should be skipped when a testsuite is run. |
|
648 | 633 |
This only a hint, a test runner is not obliged to respect return value. |
634 |
To skip a test, mark the method with a <skip> annotation |
|
529 | 635 |
Currently, the only user is stx/goodies/builder/reports" |
636 |
||
637 |
| method | |
|
648 | 638 |
|
529 | 639 |
method := self class lookupMethodFor: testSelector. |
640 |
method annotationsAt:#ignore orAt: #skip do:[:annotation| |
|
648 | 641 |
^true |
529 | 642 |
]. |
643 |
^false |
|
644 |
||
645 |
"Created: / 28-11-2012 / 18:03:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
703 | 646 |
! |
647 |
||
648 |
testCount |
|
649 |
"obsoleted, because all methods starting with 'test' |
|
650 |
are considered to be tests; so this is a bad name; |
|
705 | 651 |
please use countTests. |
652 |
See TestCase >> isTestSelector:" |
|
703 | 653 |
|
654 |
^ self countTests |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
655 |
! ! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
656 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
657 |
!TestCase methodsFor:'accessing & queries'! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
658 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
659 |
unfinished |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
660 |
|
594 | 661 |
"indicates an unfinished test" |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
662 |
! ! |
97 | 663 |
|
664 |
!TestCase methodsFor:'assertions'! |
|
66 | 665 |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
666 |
assert:aBlock completesInSeconds:aNumber |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
667 |
"fail, if aBlock does not finish its work in aNumber seconds" |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
668 |
|
179
caba0f640d13
context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
669 |
<resource: #skipInDebuggersWalkBack> |
caba0f640d13
context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
670 |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
671 |
|done process semaphore| |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
672 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
673 |
done := false. |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
674 |
semaphore := Semaphore new. |
174 | 675 |
process := [ |
594 | 676 |
aBlock value. |
677 |
done := true. |
|
678 |
semaphore signal |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
679 |
] fork. |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
680 |
semaphore waitWithTimeout: aNumber. |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
681 |
process terminate. |
222 | 682 |
self assert: done |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
683 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
684 |
" |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
685 |
self new assert:[Delay waitForSeconds:2] completesInSeconds:1 |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
686 |
" |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
687 |
" |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
688 |
self new assert:[Delay waitForSeconds:1] completesInSeconds:2 |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
689 |
" |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
690 |
! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
691 |
|
222 | 692 |
assert: aBoolean message:messageIfFailing |
531 | 693 |
<resource: #skipInDebuggersWalkBack> |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
694 |
|
222 | 695 |
^self assert: aBoolean description: messageIfFailing |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
696 |
|
531 | 697 |
"Modified: / 15-12-2012 / 17:20:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
698 |
! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
699 |
|
763 | 700 |
assertEmpty:aCollection |
701 |
<resource: #skipInDebuggersWalkBack> |
|
702 |
||
703 |
^ self assert:(aCollection isEmpty) |
|
704 |
! |
|
705 |
||
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
706 |
assertFalse:aBoolean |
179
caba0f640d13
context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
707 |
<resource: #skipInDebuggersWalkBack> |
caba0f640d13
context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
708 |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
709 |
^ self assert:aBoolean not |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
710 |
! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
711 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
712 |
assertFalse:aBoolean named:testName |
179
caba0f640d13
context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
713 |
<resource: #skipInDebuggersWalkBack> |
caba0f640d13
context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
714 |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
715 |
^ self assert:aBoolean not |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
716 |
! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
717 |
|
222 | 718 |
assertTrue:aBoolean |
179
caba0f640d13
context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
719 |
<resource: #skipInDebuggersWalkBack> |
caba0f640d13
context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
720 |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
721 |
^ self assert:aBoolean |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
722 |
! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
723 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
724 |
assertTrue:aBoolean named:testName |
179
caba0f640d13
context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
725 |
<resource: #skipInDebuggersWalkBack> |
caba0f640d13
context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
726 |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
727 |
^ self assert:aBoolean |
66 | 728 |
! ! |
729 |
||
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
730 |
!TestCase methodsFor:'dependencies'! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
731 |
|
222 | 732 |
addDependentToHierachy: anObject |
594 | 733 |
"an empty method. for Composite compability with TestSuite" |
222 | 734 |
! |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
735 |
|
222 | 736 |
removeDependentFromHierachy: anObject |
594 | 737 |
"an empty method. for Composite compability with TestSuite" |
222 | 738 |
! ! |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
739 |
|
222 | 740 |
!TestCase methodsFor:'deprecated'! |
741 |
||
742 |
should: aBlock |
|
707 | 743 |
<resource: #skipInDebuggersWalkBack> |
744 |
||
745 |
self assert: aBlock value |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
746 |
! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
747 |
|
712 | 748 |
should:result be:expected |
749 |
<resource: #skipInDebuggersWalkBack> |
|
750 |
||
751 |
^ self assert: (result = expected) |
|
752 |
description: 'should be ' , expected asString , ', but it''s ' , result asString |
|
753 |
||
754 |
" |
|
755 |
self new should:5 be:6 |
|
756 |
" |
|
757 |
! |
|
758 |
||
222 | 759 |
should: aBlock description: aString |
707 | 760 |
<resource: #skipInDebuggersWalkBack> |
761 |
||
762 |
self assert: aBlock value description: aString |
|
222 | 763 |
! |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
764 |
|
222 | 765 |
shouldnt: aBlock |
707 | 766 |
<resource: #skipInDebuggersWalkBack> |
767 |
self deny: aBlock value |
|
222 | 768 |
! |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
769 |
|
222 | 770 |
shouldnt: aBlock description: aString |
707 | 771 |
<resource: #skipInDebuggersWalkBack> |
772 |
self deny: aBlock value description: aString |
|
222 | 773 |
! |
774 |
||
775 |
signalFailure: aString |
|
707 | 776 |
<resource: #skipInDebuggersWalkBack> |
777 |
TestResult failure sunitSignalWith: aString. |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
778 |
! ! |
67 | 779 |
|
733 | 780 |
!TestCase methodsFor:'initialize / release'! |
781 |
||
782 |
setUp |
|
783 |
"can be redefined in a concrete test" |
|
784 |
! |
|
785 |
||
786 |
tearDown |
|
787 |
"can be redefined in a concrete test" |
|
788 |
! ! |
|
789 |
||
67 | 790 |
!TestCase methodsFor:'printing'! |
791 |
||
222 | 792 |
getTestName |
793 |
||
794 |
^testSelector. |
|
795 |
||
796 |
"Modified: / 05-12-2009 / 17:47:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
797 |
! |
|
798 |
||
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
799 |
name |
594 | 800 |
^ self class name. |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
801 |
! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
802 |
|
67 | 803 |
printOn: aStream |
594 | 804 |
self class printOn:aStream. |
805 |
aStream nextPutAll: '>>#'. |
|
806 |
testSelector printOn:aStream. |
|
67 | 807 |
! ! |
808 |
||
809 |
!TestCase methodsFor:'private'! |
|
810 |
||
749 | 811 |
ensureRequiredPackagesAreLoaded |
812 |
|names| |
|
813 |
||
814 |
(names := self class requiredPackageNames) isNil ifTrue:[ |
|
815 |
(names := self class coveredPackageNames) |
|
816 |
]. |
|
817 |
names notEmptyOrNil ifTrue:[ |
|
818 |
"/ ensure that the packages are loaded |
|
819 |
names do:[:each | |
|
820 |
(Smalltalk loadPackage:each) ifFalse:[ |
|
821 |
self error:('package not loaded: %1' bindWith:each) |
|
822 |
]. |
|
823 |
]. |
|
824 |
]. |
|
755 | 825 |
"/ cg: no setup here: would lead to double setup |
826 |
"/ self setUp |
|
749 | 827 |
|
828 |
"Created: / 29-05-2019 / 01:32:58 / Claus Gittinger" |
|
829 |
! |
|
830 |
||
222 | 831 |
executeShould: aBlock inScopeOf: anExceptionalEvent |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
832 |
"/ ^[aBlock value. |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
833 |
"/ false] sunitOn: anExceptionalEvent |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
834 |
"/ do: [:ex | ex sunitExitWith: true] |
103 | 835 |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
836 |
"/ [[aBlock value] |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
837 |
"/ on: anExceptionalEvent |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
838 |
"/ do: [:ex | ^true]] |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
839 |
"/ on: TestResult exError |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
840 |
"/ do: [:ex | ^false]. |
594 | 841 |
[aBlock value] |
842 |
on: anExceptionalEvent |
|
843 |
do: [:ex | ^true]. |
|
103 | 844 |
|
594 | 845 |
^false. |
67 | 846 |
! |
847 |
||
747 | 848 |
invokeTestMethod |
849 |
self perform: testSelector sunitAsSymbol |
|
850 |
||
851 |
"Created: / 29-05-2019 / 00:40:03 / Claus Gittinger" |
|
852 |
! |
|
853 |
||
67 | 854 |
performTest |
747 | 855 |
<modifier: #super> "must be called if redefined" |
856 |
||
717 | 857 |
"handle unimplemented #should message, |
858 |
so we can write: |
|
747 | 859 |
something should be:expectedResult |
717 | 860 |
" |
861 |
MessageNotUnderstood handle:[:ex | |
|
862 |
ex selector == #should ifTrue:[ |
|
863 |
ex proceedWith:( Should new testCase:self; value:ex receiver ) |
|
864 |
]. |
|
865 |
ex reject. |
|
747 | 866 |
] do:[ |
867 |
|mthd timeoutAllotation maxSecondsToRun timeoutOccurred| |
|
868 |
||
869 |
timeoutOccurred := false. |
|
870 |
mthd := self class lookupMethodFor:testSelector. |
|
871 |
mthd notNil ifTrue:[ |
|
872 |
(timeoutAllotation := mthd annotationAt:#timeout:) notNil ifTrue:[ |
|
873 |
(maxSecondsToRun := timeoutAllotation argumentAt:1 ifAbsent:[nil]) isNil ifTrue:[ |
|
874 |
Logger warning:'bad timeout annotation in %1' with:mthd whoString. |
|
875 |
]. |
|
876 |
]. |
|
877 |
]. |
|
878 |
maxSecondsToRun notNil ifTrue:[ |
|
879 |
[ |
|
880 |
self invokeTestMethod |
|
881 |
] valueWithWatchDog:[timeoutOccurred := true] afterMilliseconds:(maxSecondsToRun * 1000). |
|
882 |
] ifFalse:[ |
|
883 |
self invokeTestMethod |
|
884 |
]. |
|
885 |
timeoutOccurred ifTrue:[ |
|
750 | 886 |
self error:('test did not complete within %1 seconds (timeout)' bindWith:maxSecondsToRun) |
747 | 887 |
]. |
717 | 888 |
]. |
889 |
||
750 | 890 |
"Modified: / 29-05-2019 / 02:07:34 / Claus Gittinger" |
67 | 891 |
! |
892 |
||
576 | 893 |
safeTearDown |
894 |
"Have to handle Abort. When tearDown is called as inside an ensure block after |
|
895 |
an abort in the debugger of an errornous test case and raises an error with a debugger |
|
896 |
itself." |
|
897 |
||
898 |
AbortOperationRequest handle:[:ex| ] do:[self tearDown]. |
|
899 |
! |
|
900 |
||
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
901 |
setTestSelector: aSymbol |
594 | 902 |
testSelector := aSymbol |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
903 |
! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
904 |
|
222 | 905 |
signalFailure:aString resumable:isResumable |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
906 |
"/ TestResult failure sunitSignalWith: aString |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
907 |
|
179
caba0f640d13
context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
908 |
<resource: #skipInDebuggersWalkBack> |
caba0f640d13
context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
909 |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
910 |
isResumable ifTrue:[ |
594 | 911 |
TestResult resumableFailure |
912 |
raiseRequestWith:nil |
|
913 |
errorString:aString |
|
914 |
in:thisContext sender sender |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
915 |
] ifFalse:[ |
594 | 916 |
TestResult failure |
917 |
raiseErrorString:aString |
|
918 |
in:thisContext sender sender |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
919 |
]. |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
920 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
921 |
"Modified: / 06-08-2006 / 22:55:55 / cg" |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
922 |
! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
923 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
924 |
signalUnavailableResources |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
925 |
|
222 | 926 |
self resources do:[:res | |
594 | 927 |
res isAvailable ifFalse:[ |
928 |
^ res signalInitializationError |
|
929 |
] |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
930 |
]. |
67 | 931 |
! ! |
932 |
||
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
933 |
!TestCase methodsFor:'queries'! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
934 |
|
690 | 935 |
isLogging |
728 | 936 |
"By default, we're not logging failures. If you override this in |
937 |
a subclass, make sure that you override #failureLog" |
|
690 | 938 |
|
728 | 939 |
^ self class isLogging |
940 |
||
941 |
"Modified: / 22-03-2019 / 12:48:09 / Claus Gittinger" |
|
690 | 942 |
! |
943 |
||
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
944 |
isTestCase |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
945 |
^ true |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
946 |
! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
947 |
|
221 | 948 |
isTestCaseLike |
949 |
^ true |
|
950 |
||
951 |
"Created: / 29-06-2011 / 20:37:57 / cg" |
|
952 |
! |
|
953 |
||
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
954 |
isTestSuite |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
955 |
^ false |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
956 |
! ! |
122 | 957 |
|
67 | 958 |
!TestCase methodsFor:'running'! |
959 |
||
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
960 |
debug |
382 | 961 |
|
587 | 962 |
| testCase outcome result wasProceeded| |
382 | 963 |
|
964 |
[ |
|
685 | 965 |
result := TestResult stateError. |
966 |
wasProceeded := false. |
|
587 | 967 |
|
685 | 968 |
[ |
969 |
(testCase := self class selector: testSelector) runCase. |
|
970 |
wasProceeded ifFalse:[ |
|
971 |
result := TestResult statePass. |
|
972 |
] |
|
973 |
] sunitOn:(TestResult failure) do: [:ex | |
|
974 |
ex creator == TestSkipped ifTrue:[ |
|
731 | 975 |
TestSkipped isHandled ifTrue:[ex reject]. |
685 | 976 |
result := TestResult stateSkip. |
977 |
] ifFalse:[ |
|
978 |
result := TestResult stateFail. |
|
979 |
]. |
|
980 |
"I want a debugger to open here..." |
|
981 |
"the only really portable dialect query..." |
|
982 |
((Smalltalk respondsTo:#isSmalltalkX) and:[Smalltalk isSmalltalkX]) ifTrue:[ |
|
983 |
"/ debug |
|
984 |
Debugger |
|
985 |
enter:ex raiseContext |
|
986 |
withMessage:(ex description) |
|
987 |
mayProceed:true. |
|
706 | 988 |
ex creator == TestSkipped ifTrue:[ex return]. |
685 | 989 |
wasProceeded := true. |
990 |
ex proceed. |
|
991 |
] ifFalse:[ |
|
992 |
"is there a portable way to open a debugger?" |
|
993 |
self halt:(ex description). |
|
994 |
wasProceeded := true. |
|
995 |
]. |
|
996 |
]. |
|
524 | 997 |
|
685 | 998 |
] ensure: [ |
999 |
" if proceeded in the debugger, we arrive here; " |
|
1000 |
" but still, this is not always a pass !! " |
|
1001 |
outcome := TestCaseOutcome new. |
|
1002 |
outcome testCase: testCase. |
|
1003 |
outcome result: result. |
|
1004 |
outcome remember. |
|
1005 |
TestResource resetResources: self resources |
|
382 | 1006 |
]. |
254
7f4b9fc9756b
changed: #debug - remembers test as passed if no error occur during debugging
vrany
parents:
240
diff
changeset
|
1007 |
|
7f4b9fc9756b
changed: #debug - remembers test as passed if no error occur during debugging
vrany
parents:
240
diff
changeset
|
1008 |
"Modified: / 07-07-2011 / 11:10:50 / jv" |
7f4b9fc9756b
changed: #debug - remembers test as passed if no error occur during debugging
vrany
parents:
240
diff
changeset
|
1009 |
"Modified: / 07-07-2011 / 11:34:08 / Jan Vrany <jan.vrant@fit.cvut,cz>" |
382 | 1010 |
"Modified: / 20-08-2011 / 14:15:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
685 | 1011 |
"Modified: / 13-07-2017 / 14:02:47 / cg" |
731 | 1012 |
"Modified: / 23-03-2019 / 10:15:15 / Claus Gittinger" |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1013 |
! |
67 | 1014 |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1015 |
debugAsFailure |
594 | 1016 |
| semaphore | |
1017 |
semaphore := Semaphore new. |
|
1018 |
[semaphore wait. TestResource resetResources: self resources] fork. |
|
1019 |
(self class selector: testSelector) runCaseAsFailure: semaphore. |
|
67 | 1020 |
! |
1021 |
||
222 | 1022 |
debugUsing:aSymbol |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1023 |
self signalUnavailableResources. |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1024 |
[ |
594 | 1025 |
"/ used to be: |
1026 |
"/ (self class selector:testSelector) perform:aSymbol |
|
1027 |
"/ which is bad for subclasses which need more arguments. |
|
1028 |
"/ why not use: |
|
1029 |
"/ self copy perform:aSymbol |
|
1030 |
"/ or even |
|
1031 |
"/ self perform:aSymbol |
|
1032 |
self perform:aSymbol |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1033 |
] ensure:[ |
594 | 1034 |
self resources do:[:each | |
1035 |
each reset |
|
1036 |
] |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1037 |
] |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1038 |
! |
103 | 1039 |
|
222 | 1040 |
failureLog |
594 | 1041 |
^SUnitNameResolver class >> #defaultLogDevice |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1042 |
! |
103 | 1043 |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1044 |
logFailure: aString |
728 | 1045 |
self isLogging ifTrue: [ |
1046 |
self failureLog cr; nextPutAll: aString; flush |
|
1047 |
] |
|
222 | 1048 |
|
728 | 1049 |
"Modified (format): / 22-03-2019 / 12:49:30 / Claus Gittinger" |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1050 |
! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1051 |
|
550 | 1052 |
logSkipped: aString |
728 | 1053 |
self isLogging ifTrue: [ |
1054 |
self failureLog cr; nextPutAll: aString; flush |
|
1055 |
] |
|
1056 |
||
1057 |
"Modified (format): / 22-03-2019 / 12:49:40 / Claus Gittinger" |
|
550 | 1058 |
! |
1059 |
||
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1060 |
openDebuggerOnFailingTestMethod |
594 | 1061 |
"SUnit has halted one step in front of the failing test method. Step over the 'self halt' and |
1062 |
send into 'self perform: testSelector' to see the failure from the beginning" |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1063 |
|
594 | 1064 |
self |
1065 |
"/halt; |
|
1066 |
performTest |
|
222 | 1067 |
|
1068 |
"Modified: / 05-12-2009 / 18:40:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
67 | 1069 |
! |
1070 |
||
1071 |
run |
|
688 | 1072 |
"run this suite; return the result" |
262
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1073 |
|
461
c4a68cc4e547
use TestResultForSTX in SUnit runner
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1074 |
^self run: TestResult defaultResultClass new |
262
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1075 |
|
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1076 |
"Modified: / 29-07-2011 / 12:07:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
67 | 1077 |
! |
1078 |
||
1079 |
run: aResult |
|
688 | 1080 |
"run this suite; fill and return aResult" |
262
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1081 |
|
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1082 |
^self run: aResult beforeEachDo: [:test :result|] afterEachDo: [:test :result|] |
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1083 |
|
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1084 |
"Modified: / 29-07-2011 / 12:07:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
67 | 1085 |
! |
1086 |
||
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1087 |
run: aResult afterEachDo:block2 |
262
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1088 |
|
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1089 |
^self run: aResult beforeEachDo: [:test :result|] afterEachDo:block2 |
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1090 |
|
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1091 |
"Modified: / 29-07-2011 / 12:07:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1092 |
! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1093 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1094 |
run: aResult beforeEachDo:block1 afterEachDo:block2 |
745 | 1095 |
"run and fill (update) aResult" |
1096 |
||
1097 |
^ self |
|
1098 |
run:aResult |
|
1099 |
beforeEachDo:block1 |
|
1100 |
afterEachDo:block2 |
|
1101 |
resetResources:true |
|
262
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1102 |
|
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1103 |
"Modified: / 29-07-2011 / 12:06:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
745 | 1104 |
"Modified (comment): / 28-03-2019 / 13:22:02 / Claus Gittinger" |
262
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1105 |
! |
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1106 |
|
745 | 1107 |
run:aResult beforeEachDo:before afterEachDo:after resetResources:reset |
1108 |
"run and fill (update) aResult" |
|
1109 |
||
430 | 1110 |
^ self |
745 | 1111 |
run:aResult |
1112 |
beforeEachDo:before |
|
1113 |
afterEachDo:after |
|
1114 |
resetResources:reset |
|
1115 |
debug:false |
|
430 | 1116 |
|
1117 |
"Created: / 29-07-2011 / 12:04:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1118 |
"Modified: / 21-08-2011 / 17:45:17 / cg" |
|
745 | 1119 |
"Modified (comment): / 28-03-2019 / 13:22:55 / Claus Gittinger" |
430 | 1120 |
! |
1121 |
||
745 | 1122 |
run:result beforeEachDo:before afterEachDo:after resetResources:reset debug:doDebug |
1123 |
"Workhorse for running a testcase and updating result. |
|
1124 |
If reset is true, then |
|
262
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1125 |
the resources are reset, otherwise not" |
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1126 |
|
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1127 |
"1. Execute before block" |
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1128 |
"This code is ugly in Smalltalk/X but it is so because |
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1129 |
it is more portable - numArgs in ANSI (?)" |
737 | 1130 |
Smalltalk isSmalltalkX ifTrue:[ |
1131 |
before valueWithOptionalArgument:self and:result. |
|
262
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1132 |
] ifFalse:[ |
737 | 1133 |
before numArgs == 2 ifTrue:[ |
1134 |
before value: self value: result |
|
685 | 1135 |
] ifFalse:[ |
737 | 1136 |
before numArgs == 1 ifTrue:[ |
1137 |
before value: self |
|
1138 |
] ifFalse:[ |
|
1139 |
before value. |
|
1140 |
] |
|
1141 |
]. |
|
262
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1142 |
]. |
737 | 1143 |
|
262
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1144 |
"2. Run the testcase" |
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1145 |
reset ifTrue:[ |
685 | 1146 |
[ |
745 | 1147 |
result runCase:self debugged:doDebug |
685 | 1148 |
] ensure: [ |
1149 |
TestResource resetResources: self resources |
|
1150 |
]. |
|
262
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1151 |
] ifFalse:[ |
745 | 1152 |
result runCase:self debugged:doDebug |
262
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1153 |
]. |
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1154 |
|
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1155 |
"3. Execute after block" |
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1156 |
"This code is ugly in Smalltalk/X but it is so because |
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1157 |
it is more portable - numArgs in ANSI (?)" |
737 | 1158 |
Smalltalk isSmalltalkX ifTrue:[ |
1159 |
after valueWithOptionalArgument:self and:result. |
|
1160 |
] ifFalse:[ |
|
1161 |
after numArgs == 2 ifTrue:[ |
|
1162 |
after value: self value: result |
|
685 | 1163 |
] ifFalse:[ |
737 | 1164 |
after numArgs == 1 ifTrue:[ |
1165 |
after value: self |
|
1166 |
] ifFalse:[ |
|
1167 |
after value. |
|
1168 |
] |
|
1169 |
]. |
|
262
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1170 |
]. |
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1171 |
^result |
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1172 |
|
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1173 |
"Created: / 29-07-2011 / 12:04:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
430 | 1174 |
"Created: / 21-08-2011 / 17:44:56 / cg" |
685 | 1175 |
"Modified: / 13-07-2017 / 14:02:53 / cg" |
737 | 1176 |
"Modified: / 28-03-2019 / 11:16:47 / Claus Gittinger" |
745 | 1177 |
"Modified (format): / 28-03-2019 / 13:26:15 / Claus Gittinger" |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1178 |
! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1179 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1180 |
run: aResult beforeEachTestCaseDo:block1 afterEachTestCaseDo:block2 |
262
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1181 |
|
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1182 |
<resource: #obsolete> |
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1183 |
self obsoleteMethodWarning: 'Use #run:beforeEachDo:afterEachDo: instead'. |
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1184 |
|
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1185 |
^self run: aResult beforeEachDo:block1 afterEachDo:block2 |
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1186 |
|
3c46acd3f64a
TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents:
254
diff
changeset
|
1187 |
"Modified: / 29-07-2011 / 12:06:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1188 |
! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1189 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1190 |
runCase |
570 | 1191 |
|didSetup| |
1192 |
||
749 | 1193 |
self ensureRequiredPackagesAreLoaded. |
328
66cae160c956
added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
1194 |
self resources do: [:each | each availableFor: self]. |
66cae160c956
added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
1195 |
|
66cae160c956
added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
1196 |
[ |
685 | 1197 |
didSetup := false. |
758 | 1198 |
Error handle:[:ex | |
1199 |
Transcript showCR:'error in setup: ',ex description. |
|
1200 |
ex reject. |
|
1201 |
] do:[ |
|
1202 |
self setUp. |
|
1203 |
]. |
|
685 | 1204 |
didSetup := true. |
1205 |
self performTest. |
|
1206 |
] ensure: [ |
|
713 | 1207 |
didSetup |
1208 |
ifTrue:[ self safeTearDown ] |
|
1209 |
ifFalse:[ |
|
1210 |
"/ can we tearDown here???? |
|
1211 |
Transcript showCR:'error in setup - no teardown' |
|
1212 |
"/ self error:'error in setup' |
|
1213 |
]. |
|
328
66cae160c956
added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
1214 |
] |
66cae160c956
added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
1215 |
|
685 | 1216 |
"Modified: / 13-07-2017 / 14:03:01 / cg" |
749 | 1217 |
"Modified: / 29-05-2019 / 01:34:01 / Claus Gittinger" |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1218 |
! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1219 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1220 |
runCaseAsFailure |
749 | 1221 |
self ensureRequiredPackagesAreLoaded. |
570 | 1222 |
self setUp. |
1223 |
[ |
|
749 | 1224 |
[self openDebuggerOnFailingTestMethod] ensure: [self safeTearDown] |
570 | 1225 |
] fork |
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1226 |
|
749 | 1227 |
"Modified: / 21-06-2000 / 10:04:33 / Sames" |
1228 |
"Modified: / 29-05-2019 / 01:34:10 / Claus Gittinger" |
|
139
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1229 |
! |
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1230 |
|
5a48f282d789
back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1231 |
runCaseAsFailure: aSemaphore |
749 | 1232 |
self ensureRequiredPackagesAreLoaded. |
570 | 1233 |
[ |
685 | 1234 |
|didSetup| |
570 | 1235 |
|
685 | 1236 |
didSetup := false. |
1237 |
self resources do: [:each | each availableFor: self]. |
|
1238 |
[ |
|
1239 |
self setUp. |
|
1240 |
didSetup := true. |
|
1241 |
self openDebuggerOnFailingTestMethod |
|
1242 |
] ensure: [ |
|
713 | 1243 |
didSetup |
1244 |
ifTrue:[ self tearDown ] |
|
1245 |
ifFalse:[ |
|
1246 |
"/ can we tearDown here???? |
|
1247 |
Transcript showCR:'error in setup - no teardown' |
|
1248 |
"/ self error:'error in setup' |
|
1249 |
]. |
|
685 | 1250 |
] |
1251 |
] ensure: [aSemaphore signal]. |
|
1252 |
||
1253 |
"Modified: / 13-07-2017 / 14:03:44 / cg" |
|
749 | 1254 |
"Modified: / 29-05-2019 / 01:34:30 / Claus Gittinger" |
50 | 1255 |
! ! |
1256 |
||
717 | 1257 |
!TestCase::Should class methodsFor:'documentation'! |
1258 |
||
1259 |
documentation |
|
1260 |
" |
|
1261 |
documentation to be added. |
|
1262 |
||
1263 |
[author:] |
|
1264 |
Claus Gittinger |
|
1265 |
||
1266 |
[instance variables:] |
|
1267 |
||
1268 |
[class variables:] |
|
1269 |
||
1270 |
[see also:] |
|
1271 |
||
1272 |
" |
|
1273 |
! ! |
|
1274 |
||
1275 |
!TestCase::Should methodsFor:'accessing'! |
|
1276 |
||
719 | 1277 |
assertSelector |
1278 |
^ assertSelector ? #'assert:' |
|
1279 |
||
1280 |
"Created: / 01-07-2018 / 12:42:00 / Claus Gittinger" |
|
1281 |
! |
|
1282 |
||
717 | 1283 |
testCase:something |
1284 |
testCase := something. |
|
1285 |
! |
|
1286 |
||
1287 |
value:something |
|
1288 |
value := something. |
|
1289 |
! ! |
|
1290 |
||
1291 |
!TestCase::Should methodsFor:'verifying'! |
|
1292 |
||
1293 |
be:expectedValue |
|
1294 |
"for expressions like: |
|
1295 |
value should be:expectedValue |
|
1296 |
inside a testcase" |
|
1297 |
||
1298 |
<resource: #skipInDebuggersWalkBack> |
|
1299 |
||
719 | 1300 |
testCase perform:self assertSelector with:(value = expectedValue). |
717 | 1301 |
|
1302 |
"Created: / 01-07-2018 / 12:11:46 / Claus Gittinger" |
|
719 | 1303 |
! |
1304 |
||
1305 |
beInstanceOf:expectedClass |
|
1306 |
"for expressions like: |
|
1307 |
value should be:expectedValue |
|
1308 |
inside a testcase" |
|
1309 |
||
1310 |
<resource: #skipInDebuggersWalkBack> |
|
1311 |
||
1312 |
testCase perform:self assertSelector with:(value class == expectedClass). |
|
1313 |
||
1314 |
"Created: / 01-07-2018 / 12:38:38 / Claus Gittinger" |
|
1315 |
! |
|
1316 |
||
1317 |
equal:expectedValue |
|
1318 |
"for expressions like: |
|
1319 |
value should equal:expectedValue |
|
1320 |
inside a testcase" |
|
1321 |
||
1322 |
<resource: #skipInDebuggersWalkBack> |
|
1323 |
||
1324 |
testCase perform:self assertSelector with:(value = expectedValue). |
|
1325 |
||
1326 |
"Created: / 01-07-2018 / 12:30:08 / Claus Gittinger" |
|
1327 |
! |
|
1328 |
||
1329 |
not |
|
1330 |
assertSelector := #deny: |
|
1331 |
||
1332 |
"Created: / 01-07-2018 / 12:42:12 / Claus Gittinger" |
|
1333 |
! |
|
1334 |
||
1335 |
raise:exceptionClass |
|
1336 |
"for expressions like: |
|
1337 |
value should be:expectedValue |
|
1338 |
inside a testcase" |
|
1339 |
||
1340 |
<resource: #skipInDebuggersWalkBack> |
|
1341 |
||
1342 |
self assertSelector == #assert: ifTrue:[ |
|
1343 |
testCase should:value raise:exceptionClass |
|
1344 |
] ifFalse:[ |
|
1345 |
self assertSelector == #deny: ifTrue:[ |
|
1346 |
testCase shouldnt:value raise:exceptionClass |
|
1347 |
] ifFalse:[ |
|
1348 |
self error. |
|
1349 |
]. |
|
1350 |
]. |
|
1351 |
||
1352 |
"Created: / 01-07-2018 / 12:39:48 / Claus Gittinger" |
|
717 | 1353 |
! ! |
1354 |
||
12 | 1355 |
!TestCase class methodsFor:'documentation'! |
1356 |
||
290 | 1357 |
version |
623 | 1358 |
^ '$Header$' |
290 | 1359 |
! |
1360 |
||
203 | 1361 |
version_CVS |
623 | 1362 |
^ '$Header$' |
222 | 1363 |
! |
1364 |
||
1365 |
version_SVN |
|
623 | 1366 |
^ '$Id$' |
12 | 1367 |
! ! |
81 | 1368 |
|
550 | 1369 |
|
2 | 1370 |
TestCase initialize! |