0
|
1 |
"/
|
87
|
2 |
"/ runs a number of tests from the exept:regression package (see list below)
|
0
|
3 |
"/ execute this script using the following command line:
|
|
4 |
"/
|
8
|
5 |
"/ stx --noBanner -I --execute SelfTest.st
|
87
|
6 |
"/ use --debug to debug failed test cases.
|
0
|
7 |
"/
|
47
|
8 |
"/ to use with jenkins (+ jUnit plugin):
|
8
|
9 |
"/ use the following buildscript (in jenkins):
|
3
|
10 |
"/ (after checkout of stx)
|
|
11 |
"/ cd stx
|
|
12 |
"/ call bmake
|
|
13 |
"/ cd goodies\selftest
|
|
14 |
"/ ..\..\projects\smalltalk\stx.com --noBanner -I --execute SelfTest.st
|
|
15 |
"/
|
33
|
16 |
"/ and configure the jenkins junit plugin, to scan for "testresult.xml"
|
3
|
17 |
|
34
|
18 |
"/ tell the system, where stx is...
|
|
19 |
ParserFlags initializeSTCFlagsForTopDirectory:'../../..'.
|
|
20 |
|
0
|
21 |
Object infoPrinting:false.
|
|
22 |
ObjectMemory infoPrinting:false.
|
|
23 |
Processor activeProcess exceptionHandlerSet
|
|
24 |
on:(Class updateChangeFileQuerySignal)
|
|
25 |
do:[:ex | ex proceedWith:false ].
|
|
26 |
!
|
|
27 |
|
9
|
28 |
Stdout showCR:'Selftest Started'.
|
0
|
29 |
!
|
|
30 |
|
9
|
31 |
Stdout showCR:'Loading sunit...'.
|
0
|
32 |
Smalltalk loadPackage:'stx:goodies/sunit'.
|
26
|
33 |
self assert:(TestCase notNil and:[TestCase isLoaded]).
|
0
|
34 |
|
22
|
35 |
"/ Smalltalk loadPackage:'stx:goodies/xml/vw'.
|
|
36 |
"/ Smalltalk loadPackage:'stx:goodies/xml/stx'.
|
87
|
37 |
Smalltalk loadPackage:'stx:libcompat'.
|
47
|
38 |
Smalltalk loadPackage:'stx:libjavascript'.
|
10
|
39 |
!
|
|
40 |
|
27
|
41 |
|suite result|
|
0
|
42 |
|
15
|
43 |
Stdout showCR:'Creating suite...'.
|
4
|
44 |
suite := TestSuite named:'SelfTest'.
|
23
|
45 |
|
|
46 |
Stdout showCR:'Loading regression tests...'.
|
|
47 |
#(
|
96
|
48 |
"/ 'SunitXMLOutputTest'
|
43
|
49 |
'CoverageInstrumentationTest'
|
23
|
50 |
'AssociationTests'
|
38
|
51 |
'BinaryIOTests'
|
23
|
52 |
'BinaryTreeTester'
|
|
53 |
"/ 'BlockTest'
|
|
54 |
'CharacterTests'
|
|
55 |
'CollectionTests'
|
42
|
56 |
'CompilerTest'
|
23
|
57 |
'ComplexTest'
|
49
|
58 |
'STCCompilerTests'
|
23
|
59 |
"/ 'DebuggerTest'
|
|
60 |
"/ 'DeepCopyTests'
|
42
|
61 |
'DelayTest'
|
|
62 |
'DictionaryTest'
|
50
|
63 |
'EnumerationTests'
|
42
|
64 |
'ExceptionTest'
|
23
|
65 |
"/ 'ExternalInterfaceTests'
|
|
66 |
"/ 'FileOpenTest'
|
42
|
67 |
'FileStreamTest'
|
|
68 |
'FloatTest'
|
|
69 |
'FractionTest'
|
23
|
70 |
"/ 'GCTest'
|
|
71 |
"/ 'GraphicDrawingTest'
|
|
72 |
"/ 'HTMLParserTests'
|
|
73 |
"/ 'ImageReaderTest'
|
42
|
74 |
'IntegerTest'
|
|
75 |
'JavaScriptTests'
|
23
|
76 |
"/ 'MeasurementValueTests'
|
|
77 |
"/ 'MemoryTest'
|
|
78 |
'NumberTest'
|
|
79 |
"/ 'ParserTest'
|
42
|
80 |
'ScaledDecimalTest'
|
23
|
81 |
"/ 'SemaphoreTest'
|
|
82 |
"/ 'SharedQueueTest'
|
|
83 |
'SmallIntegerTest'
|
|
84 |
"/ 'SortTests'
|
93
|
85 |
'StringTests'
|
48
|
86 |
'StreamTests'
|
44
|
87 |
'TimeAndDateTest'
|
|
88 |
'TimeDurationTest'
|
23
|
89 |
"/ 'URLTest'
|
|
90 |
"/ 'XMLCoderTests'
|
|
91 |
"/ 'ZipArchiveTests'
|
114
|
92 |
'ClassBuilderTests'
|
|
93 |
'CompilerTests2'
|
|
94 |
'ChangeSetTests'
|
|
95 |
|
23
|
96 |
) do:[:className |
|
|
97 |
|fullName|
|
|
98 |
|
|
99 |
fullName := ('RegressionTests::',className).
|
|
100 |
Stdout showCR:('Loading ',className,'...').
|
|
101 |
Smalltalk fileInClass:fullName package:'exept:regression'.
|
95
|
102 |
(Smalltalk classNamed:fullName) isNil ifTrue:[
|
|
103 |
Stdout showCR:('**** Ouch - missing class: "',fullName,'"').
|
|
104 |
] ifFalse:[
|
|
105 |
suite addTest:(Smalltalk classNamed:fullName) suite.
|
|
106 |
]
|
23
|
107 |
].
|
4
|
108 |
|
15
|
109 |
Stdout showCR:'Running suite...'.
|
8
|
110 |
result := suite
|
94
|
111 |
run:TestResultStX new beforeEachDo:[:test |
|
15
|
112 |
Stdout showCR:('- running ',test printString).
|
87
|
113 |
]
|
|
114 |
afterEachDo:[:test| ]
|
|
115 |
debug:(Smalltalk commandLineArgumentNamed:'--debug') notNil.
|
23
|
116 |
|
38
|
117 |
Stdout showCR:'Generating report...'.
|
8
|
118 |
TestResultReporter
|
|
119 |
report:result
|
29
|
120 |
format:#xml_jUnit
|
8
|
121 |
as:'testresult.xml'.
|
38
|
122 |
|
|
123 |
Stdout showCR:'Summary:'.
|
|
124 |
Stdout showCR:(' %1 tests;' bindWith:result runCount).
|
|
125 |
Stdout show:(' %1 passed,' bindWith:result passedCount).
|
|
126 |
Stdout show:(' %1 failed,' bindWith:result failureCount).
|
|
127 |
Stdout showCR:(' %1 errors.' bindWith:result errorCount).
|
98
|
128 |
|
|
129 |
'metrics.xml' asFilename writingFileDo:[:stream |
|
99
|
130 |
MetricsReporter new
|
|
131 |
stream: stream;
|
|
132 |
packages:{
|
|
133 |
'stx:libbasic' .
|
|
134 |
'stx:libbasic2' .
|
|
135 |
'stx:libbasic3' .
|
|
136 |
'stx:libcomp' .
|
|
137 |
'stx:libview' .
|
|
138 |
'stx:libview2' .
|
|
139 |
'stx:libwidg' .
|
|
140 |
'stx:libwidg2' .
|
|
141 |
'stx:libtool' .
|
|
142 |
'stx:libtool2' .
|
|
143 |
'stx:libui' .
|
|
144 |
'stx:libhtml' .
|
|
145 |
'stx:goodies/xml' .
|
|
146 |
'stx:goodies/soap' .
|
|
147 |
'stx:libjavascript' .
|
100
|
148 |
};
|
99
|
149 |
classMetricNames: #();
|
|
150 |
methodMetricNames: #();
|
|
151 |
packageMetricNames: #( 'LOC' 'NOM' 'NOC');
|
|
152 |
reportXml_metrics.
|
98
|
153 |
].
|
|
154 |
|
0
|
155 |
!
|