Skip to content

Commit 9e2a18d

Browse files
committed
fix tests with TMP_DIR
1 parent 72099f2 commit 9e2a18d

11 files changed

+23
-23
lines changed

test/Driver/working-directory.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767

6868
// RUN: cd %t && %swiftc_driver -driver-print-jobs -working-directory %/S/Inputs -Xcc -working-directory -Xcc %/t -c %/s | %FileCheck %s -check-prefix=CLANG
6969
// CLANG: -Xcc -working-directory -Xcc SOURCE_DIR
70-
// CLANG-SAME: -Xcc -working-directory -Xcc BUILD_DIR
70+
// CLANG-SAME: -Xcc -working-directory -Xcc TMP_DIR
7171

7272
// RUN: cd %t && %swiftc_driver -driver-print-jobs -working-directory %/S/Inputs -c main.swift | %FileCheck %s -check-prefix=OUTPUT_IMPLICIT_OBJ
7373
// OUTPUT_IMPLICIT_OBJ: -o {{"?}}SOURCE_DIR/test/Driver/Inputs{{\\\\|/}}main.o

test/Macros/macro_plugin_broken_shlib.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
// RUN: c-index-test -read-diagnostics %t/macro_expand.dia 2>&1 | %FileCheck -check-prefix SERVER %s
1919

2020
// SERVER-NOT: {{error|warning}}
21-
// SERVER: test.swift:1:33: warning: external macro implementation type 'TestPlugin.FooMacro' could not be found for macro 'fooMacro'; failed to load library plugin 'BUILD_DIR/{{.*}}/libTestPlugin.dylib' in plugin server 'BUILD_DIR/{{.*}}/swift-plugin-server'; loader error: dlopen(BUILD_DIR/{{.*}}/libTestPlugin.dylib, {{.*}}): tried: 'BUILD_DIR/{{.*}}/plugins/libTestPlugin.dylib'
22-
// SERVER: test.swift:4:7: error: external macro implementation type 'TestPlugin.FooMacro' could not be found for macro 'fooMacro'; failed to load library plugin 'BUILD_DIR/{{.*}}/libTestPlugin.dylib' in plugin server 'BUILD_DIR/{{.*}}/swift-plugin-server'; loader error: dlopen(BUILD_DIR/{{.*}}/libTestPlugin.dylib, {{.*}}): tried: 'BUILD_DIR/{{.*}}/plugins/libTestPlugin.dylib'
21+
// SERVER: test.swift:1:33: warning: external macro implementation type 'TestPlugin.FooMacro' could not be found for macro 'fooMacro'; failed to load library plugin 'TMP_DIR/plugins/libTestPlugin.dylib' in plugin server 'BUILD_DIR/{{.*}}/swift-plugin-server'; loader error: dlopen(TMP_DIR/plugins/libTestPlugin.dylib, {{.*}}): tried: 'TMP_DIR/plugins/libTestPlugin.dylib'
22+
// SERVER: test.swift:4:7: error: external macro implementation type 'TestPlugin.FooMacro' could not be found for macro 'fooMacro'; failed to load library plugin 'TMP_DIR/plugins/libTestPlugin.dylib' in plugin server 'BUILD_DIR/{{.*}}/swift-plugin-server'; loader error: dlopen(TMP_DIR/plugins/libTestPlugin.dylib, {{.*}}): tried: 'TMP_DIR/plugins/libTestPlugin.dylib'
2323
// SERVER: test.swift:1:33: note: 'fooMacro' declared here
2424
// SERVER-NOT: {{error|warning}}
2525

@@ -34,8 +34,8 @@
3434
// RUN: c-index-test -read-diagnostics %t/macro_expand_inproc.dia 2>&1 | %FileCheck -check-prefix INPROC %s
3535

3636
// INPROC-NOT: {{error|warning}}
37-
// INPROC: test.swift:1:33: warning: external macro implementation type 'TestPlugin.FooMacro' could not be found for macro 'fooMacro'; failed to load library plugin 'BUILD_DIR/{{.*}}/libTestPlugin.dylib' in plugin server 'BUILD_DIR/{{.*}}/libSwiftInProcPluginServer.dylib'; loader error: dlopen(BUILD_DIR/{{.*}}/libTestPlugin.dylib, 0x0005): tried: 'BUILD_DIR/{{.*}}/libTestPlugin.dylib'
38-
// INPROC: test.swift:4:7: error: external macro implementation type 'TestPlugin.FooMacro' could not be found for macro 'fooMacro'; failed to load library plugin 'BUILD_DIR/{{.*}}/libTestPlugin.dylib' in plugin server 'BUILD_DIR/{{.*}}/libSwiftInProcPluginServer.dylib'; loader error: dlopen(BUILD_DIR/{{.*}}/libTestPlugin.dylib, 0x0005): tried: 'BUILD_DIR/{{.*}}/libTestPlugin.dylib'
37+
// INPROC: test.swift:1:33: warning: external macro implementation type 'TestPlugin.FooMacro' could not be found for macro 'fooMacro'; failed to load library plugin 'TMP_DIR/plugins/libTestPlugin.dylib' in plugin server 'BUILD_DIR/{{.*}}/libSwiftInProcPluginServer.dylib'; loader error: dlopen(TMP_DIR/plugins/libTestPlugin.dylib, 0x0005): tried: 'TMP_DIR/plugins/libTestPlugin.dylib'
38+
// INPROC: test.swift:4:7: error: external macro implementation type 'TestPlugin.FooMacro' could not be found for macro 'fooMacro'; failed to load library plugin 'TMP_DIR/plugins/libTestPlugin.dylib' in plugin server 'BUILD_DIR/{{.*}}/libSwiftInProcPluginServer.dylib'; loader error: dlopen(TMP_DIR/plugins/libTestPlugin.dylib, 0x0005): tried: 'TMP_DIR/plugins/libTestPlugin.dylib'
3939
// INPROC: test.swift:1:33: note: 'fooMacro' declared here
4040
// INPROC-NOT: {{error|warning}}
4141

test/ModuleInterface/availability-scopes.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// RUN: %target-swift-typecheck-module-from-interface(%t/Test.swiftinterface) -module-name Test -dump-availability-scopes 2>&1 | %FileCheck --strict-whitespace %s
55
// RUN: %target-swift-frontend -compile-module-from-interface %t/Test.swiftinterface -o /dev/null -module-name Test -dump-availability-scopes 2>&1 | %FileCheck --strict-whitespace %s
66

7-
// CHECK: {{^}}(root {{.*}} file={{.*}}{{/|\\}}availability-scopes.swift.tmp{{/|\\}}Test.swiftinterface
7+
// CHECK: {{^}}(root {{.*}} file=TMP_DIR{{/|\\}}Test.swiftinterface
88
// CHECK: {{^}} (decl {{.*}}unavailable=* decl=unavailable()
99
@available(*, unavailable)
1010
public func unavailable() { }

test/SILGen/magic_identifier_file_conflicting.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ def fixit_loc(start_col, orig_suffix):
9292
//
9393

9494
// CHECK-LABEL: // Mappings from '#fileID' to '#filePath':
95-
// CHECK-NEXT: // 'Foo/magic_identifier_file_conflicting.swift' => 'BUILD_DIR{{.*}}{{[/\\]}}test-{{[^/]+}}{{[/\\]}}SILGen{{[/\\]}}Output{{[/\\]}}magic_identifier_file_conflicting.swift.gyb.tmp{{[/\\]}}magic_identifier_file_conflicting.swift'
96-
// CHECK-NEXT: // 'Foo/magic_identifier_file_conflicting.swift' => 'BUILD_DIR{{.*}}{{[/\\]}}test-{{[^/]+}}{{[/\\]}}SILGen{{[/\\]}}Output{{[/\\]}}magic_identifier_file_conflicting.swift.gyb.tmp{{[/\\]}}other_path_b{{[/\\]}}magic_identifier_file_conflicting.swift' (alternate)
95+
// CHECK-NEXT: // 'Foo/magic_identifier_file_conflicting.swift' => 'TMP_DIR{{[/\\]}}magic_identifier_file_conflicting.swift'
96+
// CHECK-NEXT: // 'Foo/magic_identifier_file_conflicting.swift' => 'TMP_DIR{{[/\\]}}other_path_b{{[/\\]}}magic_identifier_file_conflicting.swift' (alternate)
9797
// CHECK-NEXT: // 'Foo/magic_identifier_file_conflicting.swift' => 'magic_identifier_file_conflicting.swift' (alternate)
9898
// CHECK-NEXT: // 'Foo/magic_identifier_file_conflicting_other.swift' => 'SOURCE_DIR{{[/\\]}}test{{[/\\]}}SILGen{{[/\\]}}Inputs{{[/\\]}}magic_identifier_file_conflicting_other.swift'
9999
// CHECK-NEXT: // 'Foo/other_file_a.swift' => 'other_file_a.swift'

test/ScanDependencies/binary_module_only.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foo
1010

1111
// BINARY_MODULE_ONLY: "swiftPrebuiltExternal": "Foo"
1212
// BINARY_MODULE_ONLY: "swiftPrebuiltExternal": {
13-
// BINARY_MODULE_ONLY-NEXT: "compiledModulePath": "BUILD_DIR/{{.*}}/ScanDependencies/Output/binary_module_only.swift.tmp/binaryModuleOnly/Foo.swiftmodule",
13+
// BINARY_MODULE_ONLY-NEXT: "compiledModulePath": "TMP_DIR/binaryModuleOnly/Foo.swiftmodule",
1414

1515
// HAS_NO_COMPILED-NOT: "{{.*}}Foo.swiftmodule{{.*}}.swiftmodule"
1616

test/ScanDependencies/diagnose_dependency_cycle_shadow.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
// RUN: not %target-swift-frontend -scan-dependencies -module-cache-path %t/module-cache %t/test.swift -o %t/deps.json -I %t/inputs -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import -module-name CycleKit &> %t/out.txt
2323
// RUN: %FileCheck --check-prefix=CHECK-NONSDK %s < %t/out.txt
2424

25-
// CHECK-NONSDK: note: source target 'CycleKit' shadowing a Swift module with the same name at: '{{.*}}{{/|\\}}diagnose_dependency_cycle_shadow.swift.tmp{{/|\\}}inputs'
25+
// CHECK-NONSDK: note: source target 'CycleKit' shadowing a Swift module with the same name at: 'TMP_DIR{{/|\\}}inputs'
2626

2727
// SDK dependency shadowing
2828
// RUN: not %target-swift-frontend -scan-dependencies -module-cache-path %t/module-cache %t/test.swift -o %t/deps.json -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import -module-name CycleKit -sdk %t/mock.sdk &> %t/out-sdk.txt

test/ScanDependencies/explicit-module-map-clang-and-swift.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
// RUN: %target-swift-frontend -emit-module -emit-module-path %t/Foo.swiftmodule -disable-implicit-swift-modules -module-cache-path %t.module-cache -explicit-swift-module-map-file %t/inputs/map.json -Rmodule-loading -Xcc -Rmodule-import %s 2>&1 | %FileCheck %s
5757

58-
// CHECK: <unknown>:0: remark: importing module 'A' from {{.*}}{{/|\\}}explicit-module-map-clang-and-swift.swift.tmp{{/|\\}}inputs{{/|\\}}A.pcm'
58+
// CHECK: <unknown>:0: remark: importing module 'A' from 'TMP_DIR{{/|\\}}inputs{{/|\\}}A.pcm'
5959

6060
import A
6161

test/ScanDependencies/preserve_used_vfs.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,34 +131,34 @@ func testIndirect() { funcRedirectedIndirect() }
131131
// CHECK: "-compile-module-from-interface"
132132
// CHECK: "-ivfsoverlay",
133133
// CHECK-NEXT: "-Xcc",
134-
// CHECK-NEXT: "{{.*}}{{/|\\}}preserve_used_vfs.swift.tmp{{/|\\}}overlay.yaml",
134+
// CHECK-NEXT: "TMP_DIR{{/|\\}}overlay.yaml",
135135
// CHECK-NEXT: "-Xcc",
136136
// CHECK-NEXT: "-ivfsoverlay",
137137
// CHECK-NEXT: "-Xcc",
138-
// CHECK-NEXT: "{{.*}}{{/|\\}}preserve_used_vfs.swift.tmp{{/|\\}}overlay-2.yaml",
138+
// CHECK-NEXT: "TMP_DIR{{/|\\}}overlay-2.yaml",
139139
// CHECK: ],
140140

141141
/// --------Clang module F
142142
// CHECK-LABEL: "modulePath": "{{.*}}{{/|\\}}F-{{.*}}.pcm",
143143
// CHECK: "commandLine": [
144144
// CHECK: "-vfsoverlay",
145-
// CHECK-NEXT: "{{.*}}{{/|\\}}preserve_used_vfs.swift.tmp{{/|\\}}overlay.yaml",
145+
// CHECK-NEXT: "TMP_DIR{{/|\\}}overlay.yaml",
146146
// CHECK-NEXT: "-vfsoverlay",
147-
// CHECK-NEXT: "{{.*}}{{/|\\}}preserve_used_vfs.swift.tmp{{/|\\}}overlay-2.yaml",
147+
// CHECK-NEXT: "TMP_DIR{{/|\\}}overlay-2.yaml",
148148
// CHECK: "-ivfsoverlay",
149149
// CHECK-NEXT: "-Xcc",
150-
// CHECK-NEXT: "{{.*}}{{/|\\}}preserve_used_vfs.swift.tmp{{/|\\}}overlay.yaml",
150+
// CHECK-NEXT: "TMP_DIR{{/|\\}}overlay.yaml",
151151
// CHECK-NEXT: "-Xcc",
152152
// CHECK-NEXT: "-ivfsoverlay",
153153
// CHECK-NEXT: "-Xcc",
154-
// CHECK-NEXT: "{{.*}}{{/|\\}}preserve_used_vfs.swift.tmp{{/|\\}}overlay-2.yaml",
154+
// CHECK-NEXT: "TMP_DIR{{/|\\}}overlay-2.yaml",
155155
// CHECK: ]
156156

157157
/// --------Clang module Indirect
158158
// CHECK-LABEL: "modulePath": "{{.*}}{{/|\\}}Indirect-{{.*}}.pcm",
159159
// CHECK-NOT: overlay.yaml
160160
// CHECK: "-vfsoverlay",
161-
// CHECK-NEXT: "{{.*}}{{/|\\}}preserve_used_vfs.swift.tmp{{/|\\}}overlay-2.yaml",
161+
// CHECK-NEXT: "TMP_DIR{{/|\\}}overlay-2.yaml",
162162
// CHECK: "-ivfsoverlay",
163163
// CHECK-NEXT: "-Xcc",
164-
// CHECK-NEXT: "{{.*}}{{/|\\}}preserve_used_vfs.swift.tmp{{/|\\}}overlay-2.yaml",
164+
// CHECK-NEXT: "TMP_DIR{{/|\\}}overlay-2.yaml",

test/ScanDependencies/separate_clang_scan_cache.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
// Ensure we the modules' output path is set to the module cache
1111
// CHECK-DEPS: "swift": "A"
1212
// CHECK-DEPS: "swift": "A"
13-
// CHECK-DEPS: "modulePath": "{{.*}}separate_clang_scan_cache.swift.tmp.module-cache{{/|\\\\}}A-{{.*}}.swiftmodule"
13+
// CHECK-DEPS: "modulePath": "TMP_DIR.module-cache{{/|\\\\}}A-{{.*}}.swiftmodule"
1414

1515
import A

test/ScanDependencies/separate_clang_scan_cache_bridging.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
// CHECK-DEPS: "clang": "F"
1515
// CHECK-DEPS-NEXT: },
1616
// CHECK-DEPS-NEXT: {
17-
// CHECK-DEPS-NEXT: "modulePath": "{{.*}}separate_clang_scan_cache_bridging.swift.tmp.module-cache{{/|\\\\}}F-{{.*}}.pcm"
17+
// CHECK-DEPS-NEXT: "modulePath": "TMP_DIR.module-cache{{/|\\\\}}F-{{.*}}.pcm"
1818

1919
// CHECK-DEPS: "swift": "A"
2020
// CHECK-DEPS-NEXT: },
2121
// CHECK-DEPS-NEXT: {
22-
// CHECK-DEPS-NEXT: "modulePath": "{{.*}}separate_clang_scan_cache_bridging.swift.tmp.module-cache{{/|\\\\}}A-{{.*}}.swiftmodule"
22+
// CHECK-DEPS-NEXT: "modulePath": "TMP_DIR.module-cache{{/|\\\\}}A-{{.*}}.swiftmodule"
2323

2424

2525

0 commit comments

Comments
 (0)