(
testCase: ParsedTestCase,
source: 'xcodebuild' | 'swift-testing' | 'swift-testing-native' = 'xcodebuild',
)
| 249 | } |
| 250 | |
| 251 | function recordTestCaseResult( |
| 252 | testCase: ParsedTestCase, |
| 253 | source: 'xcodebuild' | 'swift-testing' | 'swift-testing-native' = 'xcodebuild', |
| 254 | ): void { |
| 255 | const increment = 1; |
| 256 | completedCount += increment; |
| 257 | const durationMs = parseDurationMs(testCase.durationText); |
| 258 | |
| 259 | if (testCase.status === 'failed') { |
| 260 | applyFailureDuration(testCase.suiteName, testCase.testName, durationMs); |
| 261 | if (source !== 'swift-testing-native') { |
| 262 | failedCount += increment; |
| 263 | } |
| 264 | } else if (testCase.status === 'skipped') { |
| 265 | skippedCount += increment; |
| 266 | } |
| 267 | |
| 268 | if (source !== 'xcodebuild') { |
| 269 | testCasesCompletedSinceSwiftTestingSummary += increment; |
| 270 | if (source === 'swift-testing' && testCase.status === 'failed') { |
| 271 | testCasesFailedSinceSwiftTestingSummary += increment; |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | if (operation === 'TEST') { |
| 276 | onEvent({ |
| 277 | kind: 'test-result', |
| 278 | fragment: 'test-case-result', |
| 279 | operation: 'TEST', |
| 280 | ...(testCase.suiteName !== undefined ? { suite: testCase.suiteName } : {}), |
| 281 | test: testCase.testName, |
| 282 | status: testCase.status, |
| 283 | ...(durationMs !== undefined ? { durationMs } : {}), |
| 284 | }); |
| 285 | } |
| 286 | const suppressProgress = source === 'swift-testing-native' && testCase.status === 'failed'; |
| 287 | if (!suppressProgress) { |
| 288 | emitTestProgress(); |
| 289 | } |
| 290 | } |
| 291 | |
| 292 | function flushPendingError(): void { |
| 293 | if (!pendingError) { |
no test coverage detected