author | Claus Gittinger <cg@exept.de> |
Thu, 21 Feb 2013 13:43:08 +0100 | |
changeset 807 | ef0d821a5f02 |
parent 802 | 10e09d8f384d |
child 808 | b51c32fe6bbb |
permissions | -rw-r--r-- |
717 | 1 |
"{ Package: 'exept:regression' }" |
2 |
||
3 |
"{ NameSpace: RegressionTests }" |
|
4 |
||
5 |
Object subclass:#QuickTestRunner |
|
6 |
instanceVariableNames:'suite anyError result' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'tests-Regression' |
|
10 |
! |
|
11 |
||
12 |
!QuickTestRunner class methodsFor:'documentation'! |
|
13 |
||
14 |
documentation |
|
15 |
" |
|
16 |
ATTENTION: if you change anything here, please verify compatibility with the |
|
17 |
SeltTestRunner script found in exept/regression. |
|
18 |
||
19 |
This is meant to be called via a script or command-line argument, when executing |
|
20 |
selftests via jenkins. |
|
21 |
||
22 |
Runs a number of tests from the exept:regression package (see list below) |
|
23 |
executed through SelfTestRunner script using the following command line: |
|
24 |
||
25 |
stx --noBanner -I --execute SelfTestRunner.st |
|
26 |
use --debug to debug failed test cases. |
|
27 |
||
28 |
to use with jenkins (+ jUnit plugin): |
|
29 |
use the following buildscript (in jenkins): |
|
30 |
(after checkout of stx) |
|
31 |
cd stx |
|
32 |
call bmake |
|
33 |
cd goodies\selftest |
|
34 |
..\..\projects\smalltalk\stx.com --noBanner -I --execute SelfTestRunner.st |
|
35 |
||
36 |
and configure the jenkins junit plugin, to scan for 'testresult.xml' |
|
37 |
||
38 |
[author:] |
|
39 |
Claus Gittinger |
|
40 |
||
41 |
[instance variables:] |
|
42 |
||
43 |
[class variables:] |
|
44 |
||
45 |
[see also:] |
|
46 |
||
47 |
" |
|
48 |
! ! |
|
49 |
||
50 |
!QuickTestRunner class methodsFor:'instance creation'! |
|
51 |
||
52 |
new |
|
53 |
"return an initialized instance" |
|
54 |
||
55 |
^ self basicNew initialize. |
|
56 |
! ! |
|
57 |
||
58 |
!QuickTestRunner class methodsFor:'execution'! |
|
59 |
||
60 |
start |
|
61 |
|runner| |
|
62 |
||
63 |
runner := self new. |
|
64 |
runner |
|
65 |
prepare; |
|
66 |
buildSuite; |
|
67 |
runSuite. |
|
68 |
||
69 |
Smalltalk isStandAloneApp ifTrue:[ |
|
70 |
Smalltalk exit:(runner anyError ifTrue:[1] ifFalse:[0]) |
|
71 |
]. |
|
72 |
! ! |
|
73 |
||
74 |
!QuickTestRunner methodsFor:'execution'! |
|
75 |
||
76 |
buildSuite |
|
77 |
|anyMissing| |
|
78 |
||
79 |
anyMissing := false. |
|
80 |
||
81 |
Stdout showCR:'Creating suite...'. |
|
82 |
suite := TestSuite named:'SelfTest'. |
|
83 |
||
84 |
Stdout showCR:'Loading regression tests...'. |
|
85 |
self listOfTestClasses do:[:className | |
|
86 |
|fullName| |
|
87 |
||
88 |
fullName := ('RegressionTests::',className). |
|
89 |
Stdout showCR:('Loading ',className,'...'). |
|
90 |
Smalltalk fileInClass:fullName package:'exept:regression'. |
|
91 |
(Smalltalk classNamed:fullName) isNil ifTrue:[ |
|
92 |
Stdout showCR:('**** Ouch - missing class: "',fullName,'"'). |
|
93 |
anyMissing := true. |
|
94 |
] ifFalse:[ |
|
95 |
suite addTest:(Smalltalk classNamed:fullName) suite. |
|
96 |
] |
|
97 |
]. |
|
98 |
||
99 |
anyError := anyError | anyMissing. |
|
100 |
! |
|
101 |
||
102 |
generateReport |
|
103 |
Stdout showCR:'Generating report...'. |
|
104 |
TestResultReporter |
|
105 |
report:result |
|
106 |
format:#xml_jUnit |
|
107 |
as:'testresult.xml'. |
|
108 |
||
109 |
Stdout showCR:'Summary:'. |
|
110 |
Stdout showCR:(' %1 tests;' bindWith:result runCount). |
|
111 |
Stdout show:(' %1 passed,' bindWith:result passedCount). |
|
112 |
Stdout show:(' %1 failed,' bindWith:result failureCount). |
|
113 |
Stdout showCR:(' %1 errors.' bindWith:result errorCount). |
|
114 |
! |
|
115 |
||
116 |
listOfTestClasses |
|
117 |
^ #( |
|
118 |
||
119 |
"/ 'SunitXMLOutputTest' |
|
120 |
'CoverageInstrumentationTest' |
|
121 |
'AssociationTests' |
|
122 |
'BinaryIOTests' |
|
123 |
'BinaryTreeTester' |
|
124 |
"/ 'BlockTest' |
|
125 |
'CharacterTests' |
|
126 |
'CollectionTests' |
|
127 |
'CompilerTest' |
|
128 |
'ComplexTest' |
|
807
ef0d821a5f02
class: RegressionTests::QuickTestRunner
Claus Gittinger <cg@exept.de>
parents:
802
diff
changeset
|
129 |
'CryptTests' |
717 | 130 |
'STCCompilerTests' |
131 |
"/ 'DebuggerTest' |
|
132 |
"/ 'DeepCopyTests' |
|
133 |
'DelayTest' |
|
134 |
'DictionaryTest' |
|
135 |
'EnumerationTests' |
|
136 |
'ExceptionTest' |
|
137 |
"/ 'ExternalInterfaceTests' |
|
138 |
"/ 'FileOpenTest' |
|
139 |
'FileStreamTest' |
|
140 |
'FloatTest' |
|
141 |
'FractionTest' |
|
142 |
"/ 'GCTest' |
|
143 |
"/ 'GraphicDrawingTest' |
|
144 |
"/ 'HTMLParserTests' |
|
145 |
"/ 'ImageReaderTest' |
|
146 |
'IntegerTest' |
|
147 |
'JavaScriptTests' |
|
148 |
"/ 'MeasurementValueTests' |
|
149 |
"/ 'MemoryTest' |
|
150 |
'NumberTest' |
|
151 |
"/ 'ParserTest' |
|
152 |
'ScaledDecimalTest' |
|
153 |
"/ 'SemaphoreTest' |
|
154 |
"/ 'SharedQueueTest' |
|
155 |
'SmallIntegerTest' |
|
156 |
"/ 'SortTests' |
|
157 |
'StringTests' |
|
158 |
'StreamTests' |
|
159 |
'TimeAndDateTest' |
|
160 |
'TimeDurationTest' |
|
161 |
"/ 'URLTest' |
|
162 |
"/ 'XMLCoderTests' |
|
163 |
"/ 'ZipArchiveTests' |
|
792
5ee2f2649655
class: RegressionTests::QuickTestRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
769
diff
changeset
|
164 |
'ClassBuilderTests' |
802 | 165 |
'CompilerTests2' |
793
25cfeacc8959
Added: RegressionTests::ChangeSetTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
792
diff
changeset
|
166 |
'ChangeSetTests' |
717 | 167 |
) |
769 | 168 |
|
793
25cfeacc8959
Added: RegressionTests::ChangeSetTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
792
diff
changeset
|
169 |
"Modified: / 12-02-2013 / 16:34:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
717 | 170 |
! |
171 |
||
172 |
prepare |
|
173 |
"/ tell the system, where stx is... |
|
174 |
||
175 |
|top| |
|
176 |
||
177 |
top := Smalltalk packageDirectoryForPackageId:'stx'. |
|
178 |
"/ top := '../../..'. |
|
179 |
||
180 |
ParserFlags initializeSTCFlagsForTopDirectory:top. |
|
181 |
||
182 |
Object infoPrinting:false. |
|
183 |
ObjectMemory infoPrinting:false. |
|
184 |
||
185 |
Processor activeProcess exceptionHandlerSet |
|
186 |
on:(Class updateChangeFileQuerySignal) |
|
187 |
do:[:ex | ex proceedWith:false ]. |
|
188 |
||
189 |
Stdout showCR:'Selftest Started'. |
|
190 |
||
191 |
Stdout showCR:'Loading sunit...'. |
|
192 |
Smalltalk loadPackage:'stx:goodies/sunit'. |
|
193 |
self assert:(TestCase notNil and:[TestCase isLoaded]). |
|
194 |
||
195 |
Smalltalk loadPackage:'stx:libcompat'. |
|
196 |
Smalltalk loadPackage:'stx:libjavascript'. |
|
197 |
! |
|
198 |
||
199 |
runSuite |
|
200 |
Stdout showCR:'Running suite...'. |
|
201 |
result := suite |
|
202 |
run:TestResultStX new beforeEachDo:[:test | |
|
203 |
Stdout showCR:('- running ',test printString). |
|
204 |
] |
|
205 |
afterEachDo:[:test| ] |
|
206 |
debug:(Smalltalk commandLineArgumentNamed:'--debug') notNil. |
|
207 |
! ! |
|
208 |
||
209 |
!QuickTestRunner methodsFor:'initialization'! |
|
210 |
||
211 |
initialize |
|
212 |
anyError := false. |
|
213 |
! ! |
|
214 |
||
215 |
!QuickTestRunner class methodsFor:'documentation'! |
|
216 |
||
217 |
version |
|
218 |
^ '$Header$' |
|
219 |
! |
|
220 |
||
221 |
version_CVS |
|
222 |
^ '$Header$' |
|
223 |
! ! |
|
769 | 224 |