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'
|
|
129 |
'STCCompilerTests'
|
|
130 |
"/ 'DebuggerTest'
|
|
131 |
"/ 'DeepCopyTests'
|
|
132 |
'DelayTest'
|
|
133 |
'DictionaryTest'
|
|
134 |
'EnumerationTests'
|
|
135 |
'ExceptionTest'
|
|
136 |
"/ 'ExternalInterfaceTests'
|
|
137 |
"/ 'FileOpenTest'
|
|
138 |
'FileStreamTest'
|
|
139 |
'FloatTest'
|
|
140 |
'FractionTest'
|
|
141 |
"/ 'GCTest'
|
|
142 |
"/ 'GraphicDrawingTest'
|
|
143 |
"/ 'HTMLParserTests'
|
|
144 |
"/ 'ImageReaderTest'
|
|
145 |
'IntegerTest'
|
|
146 |
'JavaScriptTests'
|
|
147 |
"/ 'MeasurementValueTests'
|
|
148 |
"/ 'MemoryTest'
|
|
149 |
'NumberTest'
|
|
150 |
"/ 'ParserTest'
|
|
151 |
'ScaledDecimalTest'
|
|
152 |
"/ 'SemaphoreTest'
|
|
153 |
"/ 'SharedQueueTest'
|
|
154 |
'SmallIntegerTest'
|
|
155 |
"/ 'SortTests'
|
|
156 |
'StringTests'
|
|
157 |
'StreamTests'
|
|
158 |
'TimeAndDateTest'
|
|
159 |
'TimeDurationTest'
|
|
160 |
"/ 'URLTest'
|
|
161 |
"/ 'XMLCoderTests'
|
|
162 |
"/ 'ZipArchiveTests'
|
769
|
163 |
ClassBuilderTests
|
717
|
164 |
)
|
769
|
165 |
|
|
166 |
"Modified: / 07-02-2013 / 19:07:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
717
|
167 |
!
|
|
168 |
|
|
169 |
prepare
|
|
170 |
"/ tell the system, where stx is...
|
|
171 |
|
|
172 |
|top|
|
|
173 |
|
|
174 |
top := Smalltalk packageDirectoryForPackageId:'stx'.
|
|
175 |
"/ top := '../../..'.
|
|
176 |
|
|
177 |
ParserFlags initializeSTCFlagsForTopDirectory:top.
|
|
178 |
|
|
179 |
Object infoPrinting:false.
|
|
180 |
ObjectMemory infoPrinting:false.
|
|
181 |
|
|
182 |
Processor activeProcess exceptionHandlerSet
|
|
183 |
on:(Class updateChangeFileQuerySignal)
|
|
184 |
do:[:ex | ex proceedWith:false ].
|
|
185 |
|
|
186 |
Stdout showCR:'Selftest Started'.
|
|
187 |
|
|
188 |
Stdout showCR:'Loading sunit...'.
|
|
189 |
Smalltalk loadPackage:'stx:goodies/sunit'.
|
|
190 |
self assert:(TestCase notNil and:[TestCase isLoaded]).
|
|
191 |
|
|
192 |
Smalltalk loadPackage:'stx:libcompat'.
|
|
193 |
Smalltalk loadPackage:'stx:libjavascript'.
|
|
194 |
!
|
|
195 |
|
|
196 |
runSuite
|
|
197 |
Stdout showCR:'Running suite...'.
|
|
198 |
result := suite
|
|
199 |
run:TestResultStX new beforeEachDo:[:test |
|
|
200 |
Stdout showCR:('- running ',test printString).
|
|
201 |
]
|
|
202 |
afterEachDo:[:test| ]
|
|
203 |
debug:(Smalltalk commandLineArgumentNamed:'--debug') notNil.
|
|
204 |
! !
|
|
205 |
|
|
206 |
!QuickTestRunner methodsFor:'initialization'!
|
|
207 |
|
|
208 |
initialize
|
|
209 |
anyError := false.
|
|
210 |
! !
|
|
211 |
|
|
212 |
!QuickTestRunner class methodsFor:'documentation'!
|
|
213 |
|
|
214 |
version
|
|
215 |
^ '$Header$'
|
|
216 |
!
|
|
217 |
|
|
218 |
version_CVS
|
|
219 |
^ '$Header$'
|
|
220 |
! !
|
769
|
221 |
|