Skip to content

Commit 81f1e75

Browse files
authored
Merge pull request #84843 from hnrklssn/filecheck-sanitize-tmp-dir
[Utils] Sanitize %t with PathSanitizingFileCheck
2 parents 85d8d2f + 98fe7c0 commit 81f1e75

18 files changed

+57
-47
lines changed

test/CAS/cached_diagnostics_remap.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
// RUN: -emit-module -o %t/test.swiftmodule /^test/test.swift -cache-replay-prefix-map /^test %t 2>&1 | %FileCheck %s --check-prefix REMAP
3737

3838
// BRIDGE: /^test/objc.h:3:2: warning: warning in bridging header
39-
// BRIDGE-REMAP: BUILD_DIR{{.*}}{{/|\\}}objc.h:3:2: warning: warning in bridging header
39+
// BRIDGE-REMAP: TMP_DIR{{/|\\}}objc.h:3:2: warning: warning in bridging header
4040
// CHECK: /^test/test.swift:1:10: warning: this is a warning
41-
// REMAP: BUILD_DIR{{.*}}{{/|\\}}test.swift:1:10: warning: this is a warning
41+
// REMAP: TMP_DIR{{/|\\}}test.swift:1:10: warning: this is a warning
4242

4343
//--- test.swift
4444
#warning("this is a warning")

test/CAS/debug_info_pcm.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// RUN: dwarfdump --debug-info @%t/A.path | %FileCheck %s
1818

1919
// CHECK: DW_AT_GNU_dwo_name
20-
// CHECK-SAME: BUILD_DIR
20+
// CHECK-SAME: TMP_DIR
2121

2222
//--- test.swift
2323
import A

test/CAS/module_deps_clang_extras.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
// RUN: %validate-json %t/deps.json &>/dev/null
1818

1919
// RUN: %{python} %S/Inputs/SwiftDepsExtractor.py %t/deps.json Test casFSRootID > %t/fs.casid
20-
// RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-include-tree-list @%t/fs.casid | %FileCheck %s -DDIR=%basename_t -check-prefix FS_ROOT
20+
// RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-include-tree-list @%t/fs.casid | %FileCheck %s -check-prefix FS_ROOT
2121

22-
// FS_ROOT: [[DIR]].tmp/hidden/Dummy.h
23-
// FS_ROOT: [[DIR]].tmp/hidden/a.h
24-
// FS_ROOT: [[DIR]].tmp/hidden/b.h
22+
// FS_ROOT: TMP_DIR/hidden/Dummy.h
23+
// FS_ROOT: TMP_DIR/hidden/a.h
24+
// FS_ROOT: TMP_DIR/hidden/b.h
2525

2626
// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json clang:SwiftShims > %t/shim.cmd
2727
// RUN: %swift_frontend_plain @%t/shim.cmd

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/ModuleCache/SDKDependencies.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@
221221
//
222222
// DEPCHANGE-DAG: SdkLib.swiftinterface
223223
// DEPCHANGE-DAG: ExportedLib.swiftinterface
224-
// DEPCHANGE-DAG: SDKDependencies.swift
225224

226225
import SdkLib
227226

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/cxx-overlay-source-lookup.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/// --------Main module
99
// CHECK-LABEL: "modulePath": "deps.swiftmodule",
1010
// CHECK-NEXT: "sourceFiles": [
11-
// CHECK-NEXT: cxx-overlay-source-lookup.swift
11+
// CHECK-NEXT: client.swift
1212
// CHECK-NEXT: ],
1313
// CHECK: "directDependencies": [
1414
// CHECK-DAG: "swift": "Swift"

0 commit comments

Comments
 (0)