Skip to content

Commit c30abf8

Browse files
committed
[Test] Speculatively fix a non-deterministic issue
Somehow, `deinit` isn't called deterministically. Instead of using `deinit` to print out the summary, use `finalize()` which is intended to be finalize the diagnostics. Fixes rdar://problem/71046813
1 parent 96b0166 commit c30abf8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Sources/lit-test-helper/main.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,6 @@ func printParserDiags(args: CommandLineArguments) throws {
424424
class ParserDiagPrinter: DiagnosticConsumer {
425425
var counter : (error: Int, warning: Int, note: Int) = (0, 0, 0)
426426
var calculateLineColumn: Bool { return true }
427-
func finalize() {}
428427
func handle(_ diag: Diagnostic) {
429428
switch diag.message.severity {
430429
case .error:
@@ -438,7 +437,7 @@ func printParserDiags(args: CommandLineArguments) throws {
438437
}
439438
print(diag.debugDescription)
440439
}
441-
deinit {
440+
func finalize() {
442441
print("\(counter.error) error(s) \(counter.warning) warnings(s) \(counter.note) note(s)")
443442
}
444443
}

0 commit comments

Comments
 (0)