Skip to content

Commit a3eedd5

Browse files
committed
[windows] Adapt some Dependencies tests to Windows.
It seems that redirecting the stderr and then the stdout in Lit might not work like in Unix and the stderr might be redirected to the original stdout instead. To avoid that, remove the usage of cat, and redirect the stdout to a temporal file, and then the stderr there. Also, Windows do not lock the access to the file descriptor for stdout, so stdout and stderr redirected to the same place might overlap. To avoid partial matches, redirect stderr of some failing test to a temporal file, in order to match only over the output (which seems to be the only thing trying to be match). Finally, it seems that Windows libc, and Darwin/Linux libc do not match in the capitalization of some error strings. Use a pattern to match both lower case and upper case.
1 parent b9c1def commit a3eedd5

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

test/Driver/Dependencies/chained-private.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
// CHECK-SECOND-NOT: Handled
1717

1818
// RUN: touch -t 201401240006 %t/other.swift
19-
// RUN: cd %t && %swiftc_driver -c -driver-use-frontend-path "%{python};%S/Inputs/update-dependencies.py" -output-file-map %t/output.json -incremental -driver-always-rebuild-dependents ./main.swift ./other.swift ./yet-another.swift -module-name main -j1 -v 2>&1 | cat > %t/outputToCheck
20-
19+
// RUN: cd %t && %swiftc_driver -c -driver-use-frontend-path "%{python};%S/Inputs/update-dependencies.py" -output-file-map %t/output.json -incremental -driver-always-rebuild-dependents ./main.swift ./other.swift ./yet-another.swift -module-name main -j1 -v >%t/outputToCheck 2>&1
2120
// RUN: %FileCheck -check-prefix=CHECK-THIRD %s < %t/outputToCheck
2221

2322
// Driver now schedules jobs in the order the inputs were given, but

test/Driver/Dependencies/only-skip-once.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
// RUN: cp -r %S/Inputs/only-skip-once/* %t
55
// RUN: touch -t 201401240005 %t/*
66

7-
// RUN: cd %t && %target-swiftc_driver -driver-show-job-lifecycle -output-file-map %t/output-file-map.json -incremental main.swift file1.swift file2.swift -j1 2>&1 | %FileCheck -check-prefix=CHECK-INITIAL %s
7+
// RUN: cd %t && %target-swiftc_driver -driver-show-job-lifecycle -output-file-map %t/output-file-map.json -incremental main.swift file1.swift file2.swift -j1 2>%t/stderr.txt | %FileCheck -check-prefix=CHECK-INITIAL %s
88

99
// CHECK-INITIAL: Job finished: {compile: main.o <= main.swift}
1010
// CHECK-INITIAL: Job finished: {compile: file1.o <= file1.swift}
1111
// CHECK-INITIAL: Job finished: {compile: file2.o <= file2.swift}
1212
// CHECK-INITIAL: Job finished: {link: main <= main.o file1.o file2.o}
1313

1414
// RUN: touch -t 201401240006 %t/file2.swift
15-
// RUN: cd %t && %target-swiftc_driver -driver-show-job-lifecycle -output-file-map %t/output-file-map.json -incremental main.swift file1.swift file2.swift -j1 2>&1 | %FileCheck -check-prefix=CHECK-REBUILD %s
15+
// RUN: cd %t && %target-swiftc_driver -driver-show-job-lifecycle -output-file-map %t/output-file-map.json -incremental main.swift file1.swift file2.swift -j1 2>%t/stderr.txt | %FileCheck -check-prefix=CHECK-REBUILD %s
1616

1717
// We should skip the main and file1 rebuilds here, but we should only note skipping them _once_
1818
// CHECK-REBUILD: Job finished: {compile: file2.o <= file2.swift}

test/Driver/Dependencies/range-lifecycle.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@
277277

278278
// RUN: %FileCheck -check-prefix=CHECK-ADD-NEW-FILE %s < %t/output7
279279

280-
// CHECK-ADD-NEW-FILE-DAG: unable to load swift ranges file "./fileC.swiftranges", No such file or directory
281-
// CHECK-ADD-NEW-FILE-DAG: unable to determine when 'fileC.compiledsource' was last modified: No such file or directory
280+
// CHECK-ADD-NEW-FILE-DAG: unable to load swift ranges file "./fileC.swiftranges", {{N|n}}o such file or directory
281+
// CHECK-ADD-NEW-FILE-DAG: unable to determine when 'fileC.compiledsource' was last modified: {{N|n}}o such file or directory
282282
// CHECK-ADD-NEW-FILE-DAG: Queuing <Dependencies> (initial): {compile: fileC.o <= fileC.swift}
283283
// CHECK-ADD-NEW-FILE-DAG: Using dependencies: At least one input ('fileC.swift') lacks a supplementary output needed for the source range strategy.
284284
// CHECK-ADD-NEW-FILE-DAG: Queuing <Dependencies> because of dependencies discovered later: {compile: fileB.o <= fileB.swift}

0 commit comments

Comments
 (0)