author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 20 Mar 2013 12:25:22 +0100 | |
changeset 130 | ae4a40e279d6 |
parent 116 | 26775417f337 |
child 297 | a850936897fd |
permissions | -rw-r--r-- |
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...'. |
|
130
ae4a40e279d6
List of tests moved to one place so it is always the same for all three test runners (sigh, we have three different!)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
116
diff
changeset
|
47 |
|
ae4a40e279d6
List of tests moved to one place so it is always the same for all three test runners (sigh, we have three different!)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
116
diff
changeset
|
48 |
"To add a new test please edit exept_regression>>testCaseNamesWithoutNamespace" |
ae4a40e279d6
List of tests moved to one place so it is always the same for all three test runners (sigh, we have three different!)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
116
diff
changeset
|
49 |
Smalltalk fileInClass:#'exept_regression' package:'exept:regression'. |
ae4a40e279d6
List of tests moved to one place so it is always the same for all three test runners (sigh, we have three different!)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
116
diff
changeset
|
50 |
(Smalltalk at: #'exept_regression') isNil ifTrue:[ |
ae4a40e279d6
List of tests moved to one place so it is always the same for all three test runners (sigh, we have three different!)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
116
diff
changeset
|
51 |
Stdout showCR:('ERROR: Ouch - missing class: "exept_regression"'). |
ae4a40e279d6
List of tests moved to one place so it is always the same for all three test runners (sigh, we have three different!)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
116
diff
changeset
|
52 |
Smalltalk exit: 1. |
ae4a40e279d6
List of tests moved to one place so it is always the same for all three test runners (sigh, we have three different!)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
116
diff
changeset
|
53 |
]. |
ae4a40e279d6
List of tests moved to one place so it is always the same for all three test runners (sigh, we have three different!)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
116
diff
changeset
|
54 |
(Smalltalk at: #'exept_regression') testCaseNamesWithoutNamespace do:[:className | |
23 | 55 |
|fullName| |
56 |
||
57 |
fullName := ('RegressionTests::',className). |
|
58 |
Stdout showCR:('Loading ',className,'...'). |
|
59 |
Smalltalk fileInClass:fullName package:'exept:regression'. |
|
95 | 60 |
(Smalltalk classNamed:fullName) isNil ifTrue:[ |
61 |
Stdout showCR:('**** Ouch - missing class: "',fullName,'"'). |
|
62 |
] ifFalse:[ |
|
63 |
suite addTest:(Smalltalk classNamed:fullName) suite. |
|
64 |
] |
|
23 | 65 |
]. |
4 | 66 |
|
15 | 67 |
Stdout showCR:'Running suite...'. |
8 | 68 |
result := suite |
94 | 69 |
run:TestResultStX new beforeEachDo:[:test | |
15 | 70 |
Stdout showCR:('- running ',test printString). |
87 | 71 |
] |
72 |
afterEachDo:[:test| ] |
|
73 |
debug:(Smalltalk commandLineArgumentNamed:'--debug') notNil. |
|
23 | 74 |
|
38 | 75 |
Stdout showCR:'Generating report...'. |
8 | 76 |
TestResultReporter |
77 |
report:result |
|
29 | 78 |
format:#xml_jUnit |
8 | 79 |
as:'testresult.xml'. |
38 | 80 |
|
81 |
Stdout showCR:'Summary:'. |
|
82 |
Stdout showCR:(' %1 tests;' bindWith:result runCount). |
|
83 |
Stdout show:(' %1 passed,' bindWith:result passedCount). |
|
84 |
Stdout show:(' %1 failed,' bindWith:result failureCount). |
|
85 |
Stdout showCR:(' %1 errors.' bindWith:result errorCount). |
|
98 | 86 |
|
87 |
'metrics.xml' asFilename writingFileDo:[:stream | |
|
99 | 88 |
MetricsReporter new |
89 |
stream: stream; |
|
90 |
packages:{ |
|
91 |
'stx:libbasic' . |
|
92 |
'stx:libbasic2' . |
|
93 |
'stx:libbasic3' . |
|
94 |
'stx:libcomp' . |
|
95 |
'stx:libview' . |
|
96 |
'stx:libview2' . |
|
97 |
'stx:libwidg' . |
|
98 |
'stx:libwidg2' . |
|
99 |
'stx:libtool' . |
|
100 |
'stx:libtool2' . |
|
101 |
'stx:libui' . |
|
102 |
'stx:libhtml' . |
|
115 | 103 |
'stx:goodies/xml/vw' . |
99 | 104 |
'stx:goodies/soap' . |
105 |
'stx:libjavascript' . |
|
100 | 106 |
}; |
99 | 107 |
classMetricNames: #(); |
108 |
methodMetricNames: #(); |
|
109 |
packageMetricNames: #( 'LOC' 'NOM' 'NOC'); |
|
110 |
reportXml_metrics. |
|
98 | 111 |
]. |
112 |
||
0 | 113 |
! |