@@ -116,12 +116,13 @@ Function _logHeader()
116116
117117Function _collectSuiteResults ($testSuite : cs:C1710 ._TestSuite )
118118 var $suiteResult : Object
119- $suiteResult := New object:C1471 (\
120- "name" ; $testSuite .class .name ; \
121- "tests" ; []; \
122- "passed" ; 0 ; \
123- "failed" ; 0 \
124- )
119+ $suiteResult := New object:C1471 (\
120+ "name" ; $testSuite .class .name ; \
121+ "tests" ; []; \
122+ "passed" ; 0 ; \
123+ "failed" ; 0 ; \
124+ "skipped" ; 0 \
125+ )
125126
126127 var $testFunction : cs:C1710 ._TestFunction
127128 For each ($testFunction; $testSuite .testFunctions )
@@ -130,29 +131,37 @@ Function _collectSuiteResults($testSuite : cs:C1710._TestSuite)
130131
131132 This:C1470 .results .totalTests + = 1
132133
133- If ($testResult .passed )
134- This:C1470 .results .passed + = 1
135- $suiteResult .passed + = 1
136- If (This:C1470 .outputFormat = "human")
137- LOG EVENT:C667 (Into system standard outputs:K38:9 ; " ✓ " + $testResult .name + " (" + String:C10 ($testResult .duration )+ "ms)\r\n " ; Information message:K38:1 )
138- End if
139- Else
140- This:C1470 .results .failed + = 1
141- $suiteResult .failed + = 1
142- This:C1470 .results .failedTests .push ($testResult )
143- If (This:C1470 .outputFormat = "human")
144- var $errorDetails : Text
145- $errorDetails := ""
146- If ($testResult .runtimeErrors .length > 0)
147- $errorDetails := " [Runtime Error: " + $testResult .runtimeErrors [0 ].text + "]"
148- Else
149- If ($testResult .logMessages .length > 0)
150- $errorDetails := " [" + $testResult .logMessages [0 ]+ "]"
151- End if
152- End if
153- LOG EVENT:C667 (Into system standard outputs:K38:9 ; " ✗ " + $testResult .name + " (" + String:C10 ($testResult .duration )+ "ms)" + $errorDetails + "\r\n " ; Error message:K38:3 )
154- End if
155- End if
134+ If ($testResult .skipped )
135+ This:C1470 .results .skipped + = 1
136+ $suiteResult .skipped + = 1
137+ If (This:C1470 .outputFormat = "human")
138+ LOG EVENT:C667 (Into system standard outputs:K38:9 ; " - " + $testResult .name + " (skipped)\r\n " ; Information message:K38:1 )
139+ End if
140+ Else
141+ If ($testResult .passed )
142+ This:C1470 .results .passed + = 1
143+ $suiteResult .passed + = 1
144+ If (This:C1470 .outputFormat = "human")
145+ LOG EVENT:C667 (Into system standard outputs:K38:9 ; " ✓ " + $testResult .name + " (" + String:C10 ($testResult .duration )+ "ms)\r\n " ; Information message:K38:1 )
146+ End if
147+ Else
148+ This:C1470 .results .failed + = 1
149+ $suiteResult .failed + = 1
150+ This:C1470 .results .failedTests .push ($testResult )
151+ If (This:C1470 .outputFormat = "human")
152+ var $errorDetails : Text
153+ $errorDetails := ""
154+ If ($testResult .runtimeErrors .length > 0)
155+ $errorDetails := " [Runtime Error: " + $testResult .runtimeErrors [0 ].text + "]"
156+ Else
157+ If ($testResult .logMessages .length > 0)
158+ $errorDetails := " [" + $testResult .logMessages [0 ]+ "]"
159+ End if
160+ End if
161+ LOG EVENT:C667 (Into system standard outputs:K38:9 ; " ✗ " + $testResult .name + " (" + String:C10 ($testResult .duration )+ "ms)" + $errorDetails + "\r\n " ; Error message:K38:3 )
162+ End if
163+ End if
164+ End if
156165
157166 $suiteResult .tests .push ($testResult )
158167 End for each
@@ -172,18 +181,21 @@ Function _generateReport()
172181
173182Function _generateHumanReport ()
174183 var $passRate : Real
175- If (This:C1470 .results .totalTests > 0)
176- $passRate := (This:C1470 .results .passed / This:C1470 .results .totalTests )* 100
177- Else
178- $passRate := 0
179- End if
184+ var $effectiveTotal : Integer
185+ $effectiveTotal := This:C1470 .results .totalTests - This:C1470 .results .skipped
186+ If ($effectiveTotal> 0)
187+ $passRate := (This:C1470 .results .passed / $effectiveTotal)* 100
188+ Else
189+ $passRate := 0
190+ End if
180191
181192 LOG EVENT:C667 (Into system standard outputs:K38:9 ; "\r\n " ; Information message:K38:1 )
182193 LOG EVENT:C667 (Into system standard outputs:K38:9 ; "=== Test Results Summary ===\r\n " ; Information message:K38:1 )
183- LOG EVENT:C667 (Into system standard outputs:K38:9 ; "Total Tests: " + String:C10 (This:C1470 .results .totalTests )+ "\r\n " ; Information message:K38:1 )
184- LOG EVENT:C667 (Into system standard outputs:K38:9 ; "Passed: " + String:C10 (This:C1470 .results .passed )+ "\r\n " ; Information message:K38:1 )
185- LOG EVENT:C667 (Into system standard outputs:K38:9 ; "Failed: " + String:C10 (This:C1470 .results .failed )+ "\r\n " ; Information message:K38:1 )
186- LOG EVENT:C667 (Into system standard outputs:K38:9 ; "Pass Rate: " + String:C10 ($passRate ; "##0.0" )+ "%\r\n " ; Information message:K38:1 )
194+ LOG EVENT:C667 (Into system standard outputs:K38:9 ; "Total Tests: " + String:C10 (This:C1470 .results .totalTests )+ "\r\n " ; Information message:K38:1 )
195+ LOG EVENT:C667 (Into system standard outputs:K38:9 ; "Passed: " + String:C10 (This:C1470 .results .passed )+ "\r\n " ; Information message:K38:1 )
196+ LOG EVENT:C667 (Into system standard outputs:K38:9 ; "Failed: " + String:C10 (This:C1470 .results .failed )+ "\r\n " ; Information message:K38:1 )
197+ LOG EVENT:C667 (Into system standard outputs:K38:9 ; "Skipped: " + String:C10 (This:C1470 .results .skipped )+ "\r\n " ; Information message:K38:1 )
198+ LOG EVENT:C667 (Into system standard outputs:K38:9 ; "Pass Rate: " + String:C10 ($passRate ; "##0.0" )+ "%\r\n " ; Information message:K38:1 )
187199 LOG EVENT:C667 (Into system standard outputs:K38:9 ; "Duration: " + String:C10 (This:C1470 .results .duration )+ "ms\r\n " ; Information message:K38:1 )
188200
189201 If (This:C1470 .results .failed > 0)
@@ -210,12 +222,14 @@ Function _generateHumanReport()
210222 This:C1470 ._logFooter ()
211223
212224Function _generateJSONReport ()
213- var $passRate : Real
214- If (This:C1470 .results .totalTests > 0)
215- $passRate := (This:C1470 .results .passed / This:C1470 .results .totalTests )* 100
216- Else
217- $passRate := 0
218- End if
225+ var $passRate : Real
226+ var $effectiveTotal : Integer
227+ $effectiveTotal := This:C1470 .results .totalTests - This:C1470 .results .skipped
228+ If ($effectiveTotal> 0)
229+ $passRate := (This:C1470 .results .passed / $effectiveTotal)* 100
230+ Else
231+ $passRate := 0
232+ End if
219233
220234 var $jsonReport : Object
221235
@@ -226,14 +240,15 @@ Function _generateJSONReport()
226240 $jsonReport .status := (This:C1470 .results .failed = 0) ? "success" : "failure"
227241 Else
228242 // Terse mode: minimal information
229- $jsonReport := New object:C1471 (\
230- "tests" ; This:C1470 .results .totalTests ; \
231- "passed" ; This:C1470 .results .passed ; \
232- "failed" ; This:C1470 .results .failed ; \
233- "rate" ; Round:C94 ($passRate ; 1 ); \
234- "duration" ; This:C1470 .results .duration ; \
235- "status" ; (This:C1470 .results .failed = 0) ? "ok" : "fail" \
236- )
243+ $jsonReport := New object:C1471 (\
244+ "tests" ; This:C1470 .results .totalTests ; \
245+ "passed" ; This:C1470 .results .passed ; \
246+ "failed" ; This:C1470 .results .failed ; \
247+ "skipped" ; This:C1470 .results .skipped ; \
248+ "rate" ; Round:C94 ($passRate ; 1 ); \
249+ "duration" ; This:C1470 .results .duration ; \
250+ "status" ; (This:C1470 .results .failed = 0) ? "ok" : "fail" \
251+ )
237252
238253 // Only include failed tests if there are any
239254 If (This:C1470 .results .failed > 0)
@@ -262,11 +277,12 @@ Function _generateJSONReport()
262277 $suiteSummary := []
263278 var $suite : Object
264279 For each ($suite; This:C1470 .results .suites )
265- $suiteSummary .push (New object:C1471 (\
266- "name" ; $suite .name ; \
267- "passed" ; $suite .passed ; \
268- "failed" ; $suite .failed \
269- ))
280+ $suiteSummary .push (New object:C1471 (\
281+ "name" ; $suite .name ; \
282+ "passed" ; $suite .passed ; \
283+ "failed" ; $suite .failed ; \
284+ "skipped" ; $suite .skipped \
285+ ))
270286 End for each
271287 $jsonReport .suites := $suiteSummary
272288 End if
0 commit comments