Skip to content

Commit e7b3163

Browse files
committed
[test] Redirect stderr to a different file to avoid mixing with stdout.
In Windows stdout and stderr are not line buffered, so the output of stderr can be intermixed with the stdout, which will break the test when checking with CHECK-NEXT and similar. Additionally it seems that stderr always contains at least one new line. Redirecting stderr to a file removes the problems with the mixing, and since the stderr is not checked for this test, should not change anything.
1 parent 83c1e7b commit e7b3163

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/Frontend/ast-dump.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
// RUN: echo 'public func main() {a(); b()}' >%t/main.swift
55

66
// Test printing to stdout
7-
// RUN: %target-swift-frontend -dump-ast -primary-file %t/a.swift %t/b.swift %t/main.swift -module-name main -o - 2>&1 | %FileCheck -check-prefix A-AST %s
8-
// RUN: %target-swift-frontend -dump-ast %t/a.swift -primary-file %t/b.swift %t/main.swift -module-name main -o - 2>&1 | %FileCheck -check-prefix B-AST %s
9-
// RUN: %target-swift-frontend -dump-ast %t/a.swift %t/b.swift -primary-file %t/main.swift -module-name main -o - 2>&1 | %FileCheck -check-prefix MAIN-AST %s
7+
// RUN: %target-swift-frontend -dump-ast -primary-file %t/a.swift %t/b.swift %t/main.swift -module-name main -o - 2>%t/a.swift.stderr | %FileCheck -check-prefix A-AST %s
8+
// RUN: %target-swift-frontend -dump-ast %t/a.swift -primary-file %t/b.swift %t/main.swift -module-name main -o - 2>%t/b.swift.stderr | %FileCheck -check-prefix B-AST %s
9+
// RUN: %target-swift-frontend -dump-ast %t/a.swift %t/b.swift -primary-file %t/main.swift -module-name main -o - 2>%t/main.swift.stderr | %FileCheck -check-prefix MAIN-AST %s
1010

1111
// Test printing to files
1212
// RUN: %target-swift-frontend -dump-ast -primary-file %t/a.swift %t/b.swift %t/main.swift -module-name main -o %t/a.ast

0 commit comments

Comments
 (0)