author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Fri, 19 Sep 2014 17:43:20 +0200 | |
changeset 1199 | 81fcf185ef45 |
parent 1194 | 01167ea2ad14 |
child 1276 | 343771ee1f6b |
permissions | -rw-r--r-- |
1172 | 1 |
"{ Package: 'exept:regression' }" |
2 |
||
3 |
"{ NameSpace: RegressionTests }" |
|
4 |
||
5 |
TestCase subclass:#VMCrashTestCase |
|
6 |
instanceVariableNames:'' |
|
7 |
classVariableNames:'EXIT_CODE_SUCCESS EXIT_CODE_FAILURE EXIT_CODE_ERROR' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'tests-Regression-Abstract' |
|
10 |
! |
|
11 |
||
12 |
!VMCrashTestCase class methodsFor:'documentation'! |
|
13 |
||
14 |
documentation |
|
15 |
" |
|
16 |
A specialized abstract test case class for writing |
|
17 |
VM crash tests. The test is run in separate process |
|
18 |
if it eventually crashes the VM, it won't take whole test |
|
19 |
suite with it. |
|
20 |
||
1189
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
21 |
Each test case *must* be annotated by one <spawn:> annotation, |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
22 |
argument must be either `true` of `false`. If `true` then the |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
23 |
test is run in a freshly started VM. If `false`, test is run |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
24 |
in the same VM. |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
25 |
|
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
26 |
As this is meant as a base class for regression tests that used to |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
27 |
kill the VM, normally you should annotate tests with <spawn: true> |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
28 |
|
1172 | 29 |
[author:] |
30 |
Jan Vrany <jan.vrany@fit.cvut.cz> |
|
31 |
||
32 |
[instance variables:] |
|
33 |
||
34 |
[class variables:] |
|
35 |
||
36 |
[see also:] |
|
37 |
||
38 |
" |
|
39 |
! ! |
|
40 |
||
41 |
!VMCrashTestCase class methodsFor:'initialization'! |
|
42 |
||
43 |
initialize |
|
44 |
"Invoked at system start or when the class is dynamically loaded." |
|
45 |
||
46 |
"/ please change as required (and remove this comment) |
|
47 |
||
48 |
EXIT_CODE_SUCCESS := 0. |
|
49 |
EXIT_CODE_FAILURE := 1. |
|
50 |
EXIT_CODE_ERROR := 2. |
|
51 |
||
52 |
"Modified: / 05-09-2014 / 18:17:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
53 |
! ! |
|
54 |
||
55 |
!VMCrashTestCase class methodsFor:'testing'! |
|
56 |
||
57 |
isAbstract |
|
58 |
^ self == RegressionTests::VMCrashTestCase |
|
59 |
! ! |
|
60 |
||
1189
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
61 |
!VMCrashTestCase methodsFor:'accessing'! |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
62 |
|
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
63 |
timeout |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
64 |
"Returns a default timeout (sec) for the test. |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
65 |
If nil is returned, no timeout enforced. |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
66 |
|
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
67 |
Note that the timeout is set only when running under |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
68 |
report runner, interactive tools does not use it" |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
69 |
|
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
70 |
| method | |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
71 |
method := self class lookupMethodFor: testSelector. |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
72 |
method annotationsAt:#timeout: do:[:annotation| |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
73 |
^annotation arguments first |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
74 |
]. |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
75 |
^60"sec - default timeout" |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
76 |
|
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
77 |
"Created: / 08-09-2014 / 13:00:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
78 |
! ! |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
79 |
|
1172 | 80 |
!VMCrashTestCase methodsFor:'running'! |
81 |
||
82 |
runCase |
|
1189
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
83 |
"Perform the testcase. |
1172 | 84 |
|
1189
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
85 |
If testcase is annotated by <spawn: false> the test is run in the |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
86 |
very same VM. If <spawn: true>, a new VM is started and the testcase |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
87 |
in run in that new VM" |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
88 |
|
1194
01167ea2ad14
More support for debugging - file out also some scripts useful when debugging the test.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1189
diff
changeset
|
89 |
| tempDir testcaseFile exe args script environment outputFile output pid blocker status spawn | |
1172 | 90 |
|
1189
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
91 |
spawn := (self class lookupMethodFor: testSelector) annotationAt: #spawn:. |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
92 |
spawn isNil ifTrue:[ |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
93 |
self error: 'No <spawn:> annotation'. |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
94 |
]. |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
95 |
(spawn argumentAt: 1) == false ifTrue:[ |
1172 | 96 |
^ super runCase. |
1189
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
97 |
] ifFalse:[ |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
98 |
(spawn argumentAt: 1) ~~ true ifTrue:[ |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
99 |
self error: 'Argument to <spawn:> must be either `true` or `false`'. |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
100 |
] |
1172 | 101 |
]. |
102 |
||
103 |
[ |
|
1194
01167ea2ad14
More support for debugging - file out also some scripts useful when debugging the test.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1189
diff
changeset
|
104 |
tempDir := Filename newTemporary. |
01167ea2ad14
More support for debugging - file out also some scripts useful when debugging the test.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1189
diff
changeset
|
105 |
tempDir makeDirectory. |
01167ea2ad14
More support for debugging - file out also some scripts useful when debugging the test.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1189
diff
changeset
|
106 |
testcaseFile := tempDir / ((Smalltalk fileNameForClass: self class) , '.st'). |
1172 | 107 |
self class fileOutAs: testcaseFile. |
108 |
||
109 |
script := 'Smalltalk packagePath: %1. |
|
110 |
Smalltalk loadPackage:%2. |
|
111 |
Smalltalk fileIn: %3. |
|
112 |
(%4 selector: %5) runCaseInternal.' |
|
113 |
bindWith: Smalltalk packagePath asArray storeString |
|
114 |
with: self class package storeString |
|
115 |
with: testcaseFile pathName storeString |
|
116 |
with: self class name |
|
117 |
with: testSelector storeString. |
|
118 |
||
119 |
exe := OperatingSystem pathOfSTXExecutable. |
|
120 |
args := { exe . '--abortOnSEGV' . '--eval' . script }. |
|
121 |
||
122 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
123 |
args := String streamContents:[:s| |
|
124 |
args |
|
125 |
do:[:each | s nextPut:$"; nextPutAll: each; nextPut: $"] |
|
126 |
separatedBy: [ s space ] |
|
127 |
] |
|
128 |
]. |
|
129 |
||
1194
01167ea2ad14
More support for debugging - file out also some scripts useful when debugging the test.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1189
diff
changeset
|
130 |
outputFile := tempDir / 'output.txt'. |
1172 | 131 |
output := outputFile writeStream. |
132 |
||
1194
01167ea2ad14
More support for debugging - file out also some scripts useful when debugging the test.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1189
diff
changeset
|
133 |
"/ Now, spit out some helper files that for debugging. |
01167ea2ad14
More support for debugging - file out also some scripts useful when debugging the test.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1189
diff
changeset
|
134 |
( tempDir / 'run.st' ) writingFileDo:[ :f | |
01167ea2ad14
More support for debugging - file out also some scripts useful when debugging the test.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1189
diff
changeset
|
135 |
f nextPutAll: script. |
01167ea2ad14
More support for debugging - file out also some scripts useful when debugging the test.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1189
diff
changeset
|
136 |
]. |
01167ea2ad14
More support for debugging - file out also some scripts useful when debugging the test.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1189
diff
changeset
|
137 |
( tempDir / 'run.sh' ) writingFileDo:[ :f | |
01167ea2ad14
More support for debugging - file out also some scripts useful when debugging the test.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1189
diff
changeset
|
138 |
f nextPutAll: exe. |
01167ea2ad14
More support for debugging - file out also some scripts useful when debugging the test.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1189
diff
changeset
|
139 |
f space. |
01167ea2ad14
More support for debugging - file out also some scripts useful when debugging the test.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1189
diff
changeset
|
140 |
f nextPutAll: '--abortOnSEGV'. |
01167ea2ad14
More support for debugging - file out also some scripts useful when debugging the test.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1189
diff
changeset
|
141 |
f space. |
01167ea2ad14
More support for debugging - file out also some scripts useful when debugging the test.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1189
diff
changeset
|
142 |
f nextPutAll: '--execute'. |
01167ea2ad14
More support for debugging - file out also some scripts useful when debugging the test.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1189
diff
changeset
|
143 |
f space. |
01167ea2ad14
More support for debugging - file out also some scripts useful when debugging the test.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1189
diff
changeset
|
144 |
f nextPutAll: 'run.st'. |
01167ea2ad14
More support for debugging - file out also some scripts useful when debugging the test.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1189
diff
changeset
|
145 |
]. |
1172 | 146 |
environment := OperatingSystem isUNIXlike |
147 |
ifTrue:[OperatingSystem getEnvironment copy] |
|
148 |
ifFalse:[environment := Dictionary new]. |
|
149 |
blocker := Semaphore new. |
|
150 |
||
151 |
Processor monitor:[ |
|
152 |
pid := OperatingSystem exec: exe withArguments:args |
|
153 |
environment:environment |
|
1194
01167ea2ad14
More support for debugging - file out also some scripts useful when debugging the test.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1189
diff
changeset
|
154 |
fileDescriptors:"{0 . output fileDescriptor . output fileDescriptor }"#(0 1 2) |
1172 | 155 |
fork:true |
156 |
newPgrp:false |
|
157 |
inDirectory: Filename currentDirectory pathName |
|
158 |
] action: [ :s | |
|
159 |
status := s. |
|
160 |
blocker signal. |
|
161 |
]. |
|
162 |
||
163 |
output close. |
|
164 |
||
165 |
pid isNil ifTrue:[ |
|
166 |
self error: 'Failed to spawn test'. |
|
167 |
^ self. |
|
168 |
]. |
|
169 |
||
170 |
blocker wait. |
|
171 |
||
172 |
status code == EXIT_CODE_FAILURE ifTrue:[ |
|
173 |
(outputFile notNil and:[ outputFile exists ]) ifTrue:[ |
|
174 |
Stdout nextPutAll: '== TEST FAILED: '; nextPutAll: testSelector; nextPutLine:' =='. |
|
175 |
outputFile readingFileDo:[:s| |
|
176 |
[ s atEnd ] whileFalse:[ |
|
177 |
Stdout nextPutLine: s nextLine. |
|
178 |
]. |
|
179 |
]. |
|
180 |
]. |
|
181 |
self assert: false description: 'Assertion failed, see log'. |
|
182 |
]. |
|
183 |
(status code == EXIT_CODE_ERROR or:[status status == #signal]) ifTrue:[ |
|
184 |
(outputFile notNil and:[ outputFile exists ]) ifTrue:[ |
|
185 |
Stdout nextPutAll: '== TEST ERROR: '; nextPutAll: testSelector; nextPutLine:' =='. |
|
186 |
outputFile readingFileDo:[:s| |
|
187 |
[ s atEnd ] whileFalse:[ |
|
188 |
Stdout nextPutLine: s nextLine. |
|
189 |
]. |
|
190 |
]. |
|
191 |
]. |
|
192 |
self error: 'Error occured'. |
|
193 |
]. |
|
194 |
] ensure:[ |
|
1194
01167ea2ad14
More support for debugging - file out also some scripts useful when debugging the test.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1189
diff
changeset
|
195 |
(tempDir notNil and:[tempDir exists]) ifTrue:[ |
1199
81fcf185ef45
class: RegressionTests::VMCrashTestCase
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1194
diff
changeset
|
196 |
[ |
81fcf185ef45
class: RegressionTests::VMCrashTestCase
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1194
diff
changeset
|
197 |
tempDir recursiveRemove. |
81fcf185ef45
class: RegressionTests::VMCrashTestCase
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1194
diff
changeset
|
198 |
] on: Error do:[:ex | |
81fcf185ef45
class: RegressionTests::VMCrashTestCase
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1194
diff
changeset
|
199 |
OperatingSystem isMSWINDOWSlike ifFalse:[ |
81fcf185ef45
class: RegressionTests::VMCrashTestCase
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1194
diff
changeset
|
200 |
ex reject. |
81fcf185ef45
class: RegressionTests::VMCrashTestCase
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1194
diff
changeset
|
201 |
]. |
81fcf185ef45
class: RegressionTests::VMCrashTestCase
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1194
diff
changeset
|
202 |
] |
1172 | 203 |
]. |
204 |
]. |
|
205 |
||
1189
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
206 |
" |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
207 |
VMCrashTestCase run:#test_infrastructure |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
208 |
" |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
209 |
|
1172 | 210 |
"Created: / 04-09-2014 / 18:13:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1199
81fcf185ef45
class: RegressionTests::VMCrashTestCase
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1194
diff
changeset
|
211 |
"Modified: / 19-09-2014 / 16:43:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1172 | 212 |
! |
213 |
||
214 |
runCaseInternal |
|
215 |
[ |
|
216 |
super runCase. |
|
217 |
Stdout cr; |
|
218 |
nextPutAll: 'PASSED'; cr. |
|
219 |
] on: TestResult failure do:[:failure | |
|
220 |
Stdout cr; |
|
221 |
nextPutAll: 'FAILURE: '; nextPutAll: failure description; cr. |
|
222 |
Smalltalk exit: EXIT_CODE_FAILURE. |
|
223 |
] on: TestResult exError do:[:error | |
|
224 |
Stdout cr; |
|
225 |
nextPutAll: 'ERROR: '; nextPutAll: error description; cr. |
|
226 |
Smalltalk exit: EXIT_CODE_ERROR. |
|
227 |
]. |
|
228 |
||
229 |
"Created: / 04-09-2014 / 17:41:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
230 |
"Modified: / 05-09-2014 / 18:37:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
231 |
! ! |
|
232 |
||
233 |
!VMCrashTestCase methodsFor:'tests - infrastructure'! |
|
234 |
||
235 |
test_infrastructure |
|
236 |
" |
|
237 |
VMCrashTestCase run:#test_infrastructure |
|
238 |
" |
|
1189
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
239 |
<spawn: false> |
1172 | 240 |
|
241 |
| result | |
|
242 |
||
243 |
result := self class run: #tst_pass. |
|
244 |
self assert: result passedCount = 1. |
|
245 |
self assert: result failureCount = 0. |
|
246 |
self assert: result errorCount = 0. |
|
247 |
||
248 |
result := self class run: #tst_fail. |
|
249 |
self assert: result passedCount = 0. |
|
250 |
self assert: result failureCount = 1. |
|
251 |
self assert: result errorCount = 0. |
|
252 |
||
253 |
result := self class run: #tst_error. |
|
254 |
self assert: result passedCount = 0. |
|
255 |
self assert: result failureCount = 0. |
|
256 |
self assert: result errorCount = 1. |
|
257 |
||
258 |
" |
|
259 |
VMCrashTestCase run: #tst_crash. |
|
260 |
" |
|
261 |
result := self class run: #tst_crash. |
|
262 |
self assert: result passedCount = 0. |
|
263 |
self assert: result failureCount = 0. |
|
264 |
self assert: result errorCount = 1. |
|
265 |
||
266 |
"Created: / 05-09-2014 / 18:22:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1189
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
267 |
"Modified: / 08-09-2014 / 12:26:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1172 | 268 |
! |
269 |
||
270 |
tst_crash |
|
1189
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
271 |
|
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
272 |
<spawn: true> |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
273 |
|
1172 | 274 |
| bytes | |
275 |
||
1194
01167ea2ad14
More support for debugging - file out also some scripts useful when debugging the test.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1189
diff
changeset
|
276 |
Stdout nextPutLine: 'Going to crash now!!'. |
01167ea2ad14
More support for debugging - file out also some scripts useful when debugging the test.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1189
diff
changeset
|
277 |
|
1172 | 278 |
bytes := ExternalBytes address: 16r10 size: 100. |
279 |
bytes byteAt: 1 put: 10. |
|
280 |
||
281 |
"Created: / 05-09-2014 / 18:24:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1194
01167ea2ad14
More support for debugging - file out also some scripts useful when debugging the test.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1189
diff
changeset
|
282 |
"Modified: / 16-09-2014 / 20:30:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1172 | 283 |
! |
284 |
||
285 |
tst_error |
|
1189
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
286 |
<spawn: true> |
1172 | 287 |
self error:'Error' |
288 |
||
289 |
"Created: / 05-09-2014 / 18:20:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1189
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
290 |
"Modified: / 08-09-2014 / 12:26:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1172 | 291 |
! |
292 |
||
293 |
tst_fail |
|
1189
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
294 |
<spawn: true> |
1172 | 295 |
self assert: false. |
296 |
||
297 |
"Created: / 05-09-2014 / 18:20:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1189
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
298 |
"Modified: / 08-09-2014 / 12:26:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1172 | 299 |
! |
300 |
||
1189
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
301 |
tst_pass |
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
302 |
<spawn: true> |
1172 | 303 |
|
304 |
"Created: / 05-09-2014 / 18:20:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1189
6c1c1eefa063
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1172
diff
changeset
|
305 |
"Modified: / 08-09-2014 / 12:26:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1172 | 306 |
! ! |
307 |
||
308 |
!VMCrashTestCase class methodsFor:'documentation'! |
|
309 |
||
310 |
version |
|
311 |
^ '$Header$' |
|
312 |
! |
|
313 |
||
314 |
version_CVS |
|
315 |
^ '$Header$' |
|
316 |
! ! |
|
317 |
||
318 |
||
319 |
VMCrashTestCase initialize! |