Skip to content

Commit eeeb01a

Browse files
committed
Enable Spec support in TestHarness and give details on unsupported optional tests and assertions
Signed-off-by: Stefan Marr <[email protected]>
1 parent 3b4d811 commit eeeb01a

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

TestSuite/TestHarness.som

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,29 @@ TestHarness = (
9595
)
9696

9797
runOneSuite: name = (
98-
| testName runner |
98+
| testName runner totalTestNum successfulTestNum unsupportedTestNum totalAssertionNum |
9999
testName := name.
100-
(testName endsWith: 'Test') ifFalse: [
100+
((testName endsWith: 'Test') or: [testName endsWith: 'Spec']) ifFalse: [
101101
testName := testName + 'Test'].
102102

103103
runner := TestRunner new.
104104
runner initializeOn: (system resolve: testName asSymbol).
105105
runner run.
106-
runner hasFailures ifTrue: [system exit: 1]
106+
107+
totalTestNum := runner expectedPasses.
108+
unsupportedTestNum := runner actualUnsupported.
109+
successfulTestNum := runner actualPasses.
110+
totalAssertionNum := runner numAsserts.
111+
112+
'Number of unsupported optionals: ' print.
113+
unsupportedTestNum println.
114+
'Number of assertions tested: ' print.
115+
totalAssertionNum println.
116+
117+
(failOnUnsupportedOptionals and: [unsupportedTestNum > 0])
118+
ifTrue: [system exit: 1].
119+
totalTestNum = successfulTestNum
120+
ifFalse: [system exit: 1].
107121
)
108122

109123
run: args = (

0 commit comments

Comments
 (0)