Skip to content

Commit c3f117c

Browse files
authored
[test] Fix Driver tests not to write to PWD (a shared directory) (#19406)
Hopefully fixes some of the weird failures we're seeing in rdar://problem/42247881, though I'm not sure how it would be responsible for some of them.
1 parent 1413cb1 commit c3f117c

7 files changed

+11
-11
lines changed

test/Driver/batch_mode_with_num-threads.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
//
1111
// Make sure that it actually works. (The link step fails if -num-threads is not ignored.)
1212
//
13-
// RUN: %swiftc_driver -enable-batch-mode -num-threads 2 %t/main.swift -import-objc-header %t/bridgingHeader.h
13+
// RUN: %swiftc_driver -enable-batch-mode -num-threads 2 -c %t/main.swift -import-objc-header %t/bridgingHeader.h -o %t/main.o

test/Driver/batch_mode_with_pch.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
// RUN: echo 'print("Hello, World!")' >%t/main.swift
33
// RUN: touch %t/bridgingHeader.h
44
//
5-
// RUN: %swiftc_driver -driver-filelist-threshold=0 -enable-batch-mode -num-threads 2 %t/main.swift -import-objc-header %t/bridgingHeader.h
5+
// RUN: %swiftc_driver -driver-filelist-threshold=0 -enable-batch-mode -num-threads 2 -c %t/main.swift -import-objc-header %t/bridgingHeader.h -o %t/main.o

test/Driver/loaded_module_trace_append.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: rm -f %t
2-
// RUN: env SWIFT_LOADED_MODULE_TRACE_FILE=%t %target-build-swift -module-name loaded_module_trace_append %s -o- > /dev/null
3-
// RUN: env SWIFT_LOADED_MODULE_TRACE_FILE=%t %target-build-swift -module-name loaded_module_trace_append2 %s -o- > /dev/null
2+
// RUN: env SWIFT_LOADED_MODULE_TRACE_FILE=%t %target-build-swift -module-name loaded_module_trace_append -c %s -o- > /dev/null
3+
// RUN: env SWIFT_LOADED_MODULE_TRACE_FILE=%t %target-build-swift -module-name loaded_module_trace_append2 -c %s -o- > /dev/null
44
// RUN: %FileCheck %s < %t
55

66
// CHECK: {"name":"loaded_module_trace_append",{{.*}}]}

test/Driver/loaded_module_trace_env.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: rm -f %t
2-
// RUN: env SWIFT_LOADED_MODULE_TRACE_FILE=%t %target-build-swift -module-name loaded_module_trace_env %s -o- > /dev/null
2+
// RUN: env SWIFT_LOADED_MODULE_TRACE_FILE=%t %target-build-swift -module-name loaded_module_trace_env -c %s -o- > /dev/null
33
// RUN: %FileCheck %s < %t
44

55
// CHECK: {

test/Driver/loaded_module_trace_header.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: rm -f %t
2-
// RUN: env SWIFT_LOADED_MODULE_TRACE_FILE=%t %target-build-swift -module-name loaded_module_trace_header %s -o- -import-objc-header %S/Inputs/loaded_module_trace_header.h > /dev/null
2+
// RUN: env SWIFT_LOADED_MODULE_TRACE_FILE=%t %target-build-swift -module-name loaded_module_trace_header -c %s -o- -import-objc-header %S/Inputs/loaded_module_trace_header.h > /dev/null
33
// RUN: %FileCheck %s < %t
44

55
// REQUIRES: objc_interop

test/Driver/multi-threaded.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// RUN: %target-swiftc_driver -driver-print-jobs -module-name=ThisModule -wmo -num-threads 4 %S/Inputs/main.swift %s -c | %FileCheck -check-prefix=OBJECT %s
66
// RUN: %target-swiftc_driver -parseable-output -module-name=ThisModule -wmo -num-threads 4 %S/Inputs/main.swift %s -c 2> %t/parseable-output
77
// RUN: cat %t/parseable-output | %FileCheck -check-prefix=PARSEABLE %s
8-
// RUN: env TMPDIR=/tmp %swiftc_driver -driver-print-jobs -module-name=ThisModule -wmo -num-threads 4 %S/Inputs/main.swift %s -o a.out | %FileCheck -check-prefix=EXEC %s
8+
// RUN: (cd %t && env TMPDIR=/tmp %swiftc_driver -driver-print-jobs -module-name=ThisModule -wmo -num-threads 4 %S/Inputs/main.swift %s -o a.out ) | %FileCheck -check-prefix=EXEC %s
99
// RUN: echo "{\"%s\": {\"llvm-bc\": \"multi-threaded.bc\", \"object\": \"%t/multi-threaded.o\"}, \"%S/Inputs/main.swift\": {\"llvm-bc\": \"main.bc\", \"object\": \"%t/main.o\"}}" > %t/ofmo.json
1010
// RUN: %target-swiftc_driver -module-name=ThisModule -wmo -num-threads 4 %S/Inputs/main.swift %s -emit-dependencies -output-file-map %t/ofmo.json -c
1111
// RUN: cat %t/*.d | %FileCheck -check-prefix=DEPENDENCIES %s
@@ -18,7 +18,7 @@
1818
// RUN: cat %t/parseable2 | %FileCheck -check-prefix=PARSEABLE2 %s
1919

2020
// Check if linking works with -parseable-output
21-
// RUN: %target-swiftc_driver -parseable-output -module-name=ThisModule -wmo -num-threads 4 %S/Inputs/main.swift %s -output-file-map %t/ofmo.json -o a.out 2> %t/parseable3
21+
// RUN: (cd %t && %target-swiftc_driver -parseable-output -module-name=ThisModule -wmo -num-threads 4 %S/Inputs/main.swift %s -output-file-map %t/ofmo.json -o a.out) 2> %t/parseable3
2222
// RUN: cat %t/parseable3 | %FileCheck -check-prefix=PARSEABLE3 %s
2323

2424
// MODULE: -frontend

test/Driver/response-file.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
// RUN: %target-build-swift -typecheck @%t.5.resp %s 2>&1 | %FileCheck %s -check-prefix=LONG
2929
// LONG: warning: result of call to 'abs' is unused
3030
// RUN: %empty-directory(%t/tmp)
31-
// RUN: env TMPDIR=%t/tmp/ %target-swiftc_driver %s @%t.5.resp -save-temps 2>&1
31+
// RUN: env TMPDIR=%t/tmp/ %target-swiftc_driver %s @%t.5.resp -save-temps -o %t/main
3232
// RUN: ls %t/tmp/arguments-*.resp
33-
// RUN: %target-build-swift -v @%t.5.resp %s 2>&1 | %FileCheck %s -check-prefix=VERBOSE
34-
// VERBOSE: @{{[^ ]*}}arguments-{{[0-9a-zA-Z]+}}.resp # -frontend -c -primary-file
33+
// RUN: %target-build-swift -typecheck -v @%t.5.resp %s 2>&1 | %FileCheck %s -check-prefix=VERBOSE
34+
// VERBOSE: @{{[^ ]*}}arguments-{{[0-9a-zA-Z]+}}.resp # -frontend -typecheck -primary-file
3535
// RUN: not %target-swiftc_driver %s @%t.5.resp -Xfrontend -debug-crash-immediately 2>&1 | %FileCheck %s -check-prefix=CRASH
3636
// CRASH: Program arguments: {{[^ ]*}}swift -frontend -c -primary-file
3737

0 commit comments

Comments
 (0)