@@ -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
@@ -168,18 +177,21 @@ Function _generateReport()
168177
169178Function _generateHumanReport ()
170179 var $passRate : Real
171- If (This:C1470 .results .totalTests > 0)
172- $passRate := (This:C1470 .results .passed / This:C1470 .results .totalTests )* 100
173- Else
174- $passRate := 0
175- End if
180+ var $effectiveTotal : Integer
181+ $effectiveTotal := This:C1470 .results .totalTests - This:C1470 .results .skipped
182+ If ($effectiveTotal> 0)
183+ $passRate := (This:C1470 .results .passed / $effectiveTotal)* 100
184+ Else
185+ $passRate := 0
186+ End if
176187
177188 LOG EVENT:C667 (Into system standard outputs:K38:9 ; "\r\n " ; Information message:K38:1 )
178189 LOG EVENT:C667 (Into system standard outputs:K38:9 ; "=== Test Results Summary ===\r\n " ; Information message:K38:1 )
179- LOG EVENT:C667 (Into system standard outputs:K38:9 ; "Total Tests: " + String:C10 (This:C1470 .results .totalTests )+ "\r\n " ; Information message:K38:1 )
180- LOG EVENT:C667 (Into system standard outputs:K38:9 ; "Passed: " + String:C10 (This:C1470 .results .passed )+ "\r\n " ; Information message:K38:1 )
181- LOG EVENT:C667 (Into system standard outputs:K38:9 ; "Failed: " + String:C10 (This:C1470 .results .failed )+ "\r\n " ; Information message:K38:1 )
182- LOG EVENT:C667 (Into system standard outputs:K38:9 ; "Pass Rate: " + String:C10 ($passRate ; "##0.0" )+ "%\r\n " ; Information message:K38:1 )
190+ LOG EVENT:C667 (Into system standard outputs:K38:9 ; "Total Tests: " + String:C10 (This:C1470 .results .totalTests )+ "\r\n " ; Information message:K38:1 )
191+ LOG EVENT:C667 (Into system standard outputs:K38:9 ; "Passed: " + String:C10 (This:C1470 .results .passed )+ "\r\n " ; Information message:K38:1 )
192+ LOG EVENT:C667 (Into system standard outputs:K38:9 ; "Failed: " + String:C10 (This:C1470 .results .failed )+ "\r\n " ; Information message:K38:1 )
193+ LOG EVENT:C667 (Into system standard outputs:K38:9 ; "Skipped: " + String:C10 (This:C1470 .results .skipped )+ "\r\n " ; Information message:K38:1 )
194+ LOG EVENT:C667 (Into system standard outputs:K38:9 ; "Pass Rate: " + String:C10 ($passRate ; "##0.0" )+ "%\r\n " ; Information message:K38:1 )
183195 LOG EVENT:C667 (Into system standard outputs:K38:9 ; "Duration: " + String:C10 (This:C1470 .results .duration )+ "ms\r\n " ; Information message:K38:1 )
184196
185197 If (This:C1470 .results .failed > 0)
@@ -206,12 +218,14 @@ Function _generateHumanReport()
206218 This:C1470 ._logFooter ()
207219
208220Function _generateJSONReport ()
209- var $passRate : Real
210- If (This:C1470 .results .totalTests > 0)
211- $passRate := (This:C1470 .results .passed / This:C1470 .results .totalTests )* 100
212- Else
213- $passRate := 0
214- End if
221+ var $passRate : Real
222+ var $effectiveTotal : Integer
223+ $effectiveTotal := This:C1470 .results .totalTests - This:C1470 .results .skipped
224+ If ($effectiveTotal> 0)
225+ $passRate := (This:C1470 .results .passed / $effectiveTotal)* 100
226+ Else
227+ $passRate := 0
228+ End if
215229
216230 var $jsonReport : Object
217231
@@ -222,14 +236,15 @@ Function _generateJSONReport()
222236 $jsonReport .status := (This:C1470 .results .failed = 0) ? "success" : "failure"
223237 Else
224238 // Terse mode: minimal information
225- $jsonReport := New object:C1471 (\
226- "tests" ; This:C1470 .results .totalTests ; \
227- "passed" ; This:C1470 .results .passed ; \
228- "failed" ; This:C1470 .results .failed ; \
229- "rate" ; Round:C94 ($passRate ; 1 ); \
230- "duration" ; This:C1470 .results .duration ; \
231- "status" ; (This:C1470 .results .failed = 0) ? "ok" : "fail" \
232- )
239+ $jsonReport := New object:C1471 (\
240+ "tests" ; This:C1470 .results .totalTests ; \
241+ "passed" ; This:C1470 .results .passed ; \
242+ "failed" ; This:C1470 .results .failed ; \
243+ "skipped" ; This:C1470 .results .skipped ; \
244+ "rate" ; Round:C94 ($passRate ; 1 ); \
245+ "duration" ; This:C1470 .results .duration ; \
246+ "status" ; (This:C1470 .results .failed = 0) ? "ok" : "fail" \
247+ )
233248
234249 // Only include failed tests if there are any
235250 If (This:C1470 .results .failed > 0)
@@ -258,11 +273,12 @@ Function _generateJSONReport()
258273 $suiteSummary := []
259274 var $suite : Object
260275 For each ($suite; This:C1470 .results .suites )
261- $suiteSummary .push (New object:C1471 (\
262- "name" ; $suite .name ; \
263- "passed" ; $suite .passed ; \
264- "failed" ; $suite .failed \
265- ))
276+ $suiteSummary .push (New object:C1471 (\
277+ "name" ; $suite .name ; \
278+ "passed" ; $suite .passed ; \
279+ "failed" ; $suite .failed ; \
280+ "skipped" ; $suite .skipped \
281+ ))
266282 End for each
267283 $jsonReport .suites := $suiteSummary
268284 End if
0 commit comments