fix tests with TMP_DIR

This commit is contained in:
Henrik G. Olsson
2025-10-12 16:01:30 -07:00
parent 72099f2093
commit 9e2a18d401
11 changed files with 23 additions and 23 deletions

View File

@@ -67,7 +67,7 @@
// RUN: cd %t && %swiftc_driver -driver-print-jobs -working-directory %/S/Inputs -Xcc -working-directory -Xcc %/t -c %/s | %FileCheck %s -check-prefix=CLANG // RUN: cd %t && %swiftc_driver -driver-print-jobs -working-directory %/S/Inputs -Xcc -working-directory -Xcc %/t -c %/s | %FileCheck %s -check-prefix=CLANG
// CLANG: -Xcc -working-directory -Xcc SOURCE_DIR // CLANG: -Xcc -working-directory -Xcc SOURCE_DIR
// CLANG-SAME: -Xcc -working-directory -Xcc BUILD_DIR // CLANG-SAME: -Xcc -working-directory -Xcc TMP_DIR
// RUN: cd %t && %swiftc_driver -driver-print-jobs -working-directory %/S/Inputs -c main.swift | %FileCheck %s -check-prefix=OUTPUT_IMPLICIT_OBJ // RUN: cd %t && %swiftc_driver -driver-print-jobs -working-directory %/S/Inputs -c main.swift | %FileCheck %s -check-prefix=OUTPUT_IMPLICIT_OBJ
// OUTPUT_IMPLICIT_OBJ: -o {{"?}}SOURCE_DIR/test/Driver/Inputs{{\\\\|/}}main.o // OUTPUT_IMPLICIT_OBJ: -o {{"?}}SOURCE_DIR/test/Driver/Inputs{{\\\\|/}}main.o

View File

@@ -18,8 +18,8 @@
// RUN: c-index-test -read-diagnostics %t/macro_expand.dia 2>&1 | %FileCheck -check-prefix SERVER %s // RUN: c-index-test -read-diagnostics %t/macro_expand.dia 2>&1 | %FileCheck -check-prefix SERVER %s
// SERVER-NOT: {{error|warning}} // SERVER-NOT: {{error|warning}}
// 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' // 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'
// 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' // 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'
// SERVER: test.swift:1:33: note: 'fooMacro' declared here // SERVER: test.swift:1:33: note: 'fooMacro' declared here
// SERVER-NOT: {{error|warning}} // SERVER-NOT: {{error|warning}}
@@ -34,8 +34,8 @@
// RUN: c-index-test -read-diagnostics %t/macro_expand_inproc.dia 2>&1 | %FileCheck -check-prefix INPROC %s // RUN: c-index-test -read-diagnostics %t/macro_expand_inproc.dia 2>&1 | %FileCheck -check-prefix INPROC %s
// INPROC-NOT: {{error|warning}} // INPROC-NOT: {{error|warning}}
// 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' // 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'
// 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' // 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'
// INPROC: test.swift:1:33: note: 'fooMacro' declared here // INPROC: test.swift:1:33: note: 'fooMacro' declared here
// INPROC-NOT: {{error|warning}} // INPROC-NOT: {{error|warning}}

View File

@@ -4,7 +4,7 @@
// RUN: %target-swift-typecheck-module-from-interface(%t/Test.swiftinterface) -module-name Test -dump-availability-scopes 2>&1 | %FileCheck --strict-whitespace %s // RUN: %target-swift-typecheck-module-from-interface(%t/Test.swiftinterface) -module-name Test -dump-availability-scopes 2>&1 | %FileCheck --strict-whitespace %s
// 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 // 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
// CHECK: {{^}}(root {{.*}} file={{.*}}{{/|\\}}availability-scopes.swift.tmp{{/|\\}}Test.swiftinterface // CHECK: {{^}}(root {{.*}} file=TMP_DIR{{/|\\}}Test.swiftinterface
// CHECK: {{^}} (decl {{.*}}unavailable=* decl=unavailable() // CHECK: {{^}} (decl {{.*}}unavailable=* decl=unavailable()
@available(*, unavailable) @available(*, unavailable)
public func unavailable() { } public func unavailable() { }

View File

@@ -92,8 +92,8 @@ def fixit_loc(start_col, orig_suffix):
// //
// CHECK-LABEL: // Mappings from '#fileID' to '#filePath': // CHECK-LABEL: // Mappings from '#fileID' to '#filePath':
// 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' // CHECK-NEXT: // 'Foo/magic_identifier_file_conflicting.swift' => 'TMP_DIR{{[/\\]}}magic_identifier_file_conflicting.swift'
// 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) // CHECK-NEXT: // 'Foo/magic_identifier_file_conflicting.swift' => 'TMP_DIR{{[/\\]}}other_path_b{{[/\\]}}magic_identifier_file_conflicting.swift' (alternate)
// CHECK-NEXT: // 'Foo/magic_identifier_file_conflicting.swift' => 'magic_identifier_file_conflicting.swift' (alternate) // CHECK-NEXT: // 'Foo/magic_identifier_file_conflicting.swift' => 'magic_identifier_file_conflicting.swift' (alternate)
// CHECK-NEXT: // 'Foo/magic_identifier_file_conflicting_other.swift' => 'SOURCE_DIR{{[/\\]}}test{{[/\\]}}SILGen{{[/\\]}}Inputs{{[/\\]}}magic_identifier_file_conflicting_other.swift' // CHECK-NEXT: // 'Foo/magic_identifier_file_conflicting_other.swift' => 'SOURCE_DIR{{[/\\]}}test{{[/\\]}}SILGen{{[/\\]}}Inputs{{[/\\]}}magic_identifier_file_conflicting_other.swift'
// CHECK-NEXT: // 'Foo/other_file_a.swift' => 'other_file_a.swift' // CHECK-NEXT: // 'Foo/other_file_a.swift' => 'other_file_a.swift'

View File

@@ -10,7 +10,7 @@ import Foo
// BINARY_MODULE_ONLY: "swiftPrebuiltExternal": "Foo" // BINARY_MODULE_ONLY: "swiftPrebuiltExternal": "Foo"
// BINARY_MODULE_ONLY: "swiftPrebuiltExternal": { // BINARY_MODULE_ONLY: "swiftPrebuiltExternal": {
// BINARY_MODULE_ONLY-NEXT: "compiledModulePath": "BUILD_DIR/{{.*}}/ScanDependencies/Output/binary_module_only.swift.tmp/binaryModuleOnly/Foo.swiftmodule", // BINARY_MODULE_ONLY-NEXT: "compiledModulePath": "TMP_DIR/binaryModuleOnly/Foo.swiftmodule",
// HAS_NO_COMPILED-NOT: "{{.*}}Foo.swiftmodule{{.*}}.swiftmodule" // HAS_NO_COMPILED-NOT: "{{.*}}Foo.swiftmodule{{.*}}.swiftmodule"

View File

@@ -22,7 +22,7 @@
// 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 // 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
// RUN: %FileCheck --check-prefix=CHECK-NONSDK %s < %t/out.txt // RUN: %FileCheck --check-prefix=CHECK-NONSDK %s < %t/out.txt
// CHECK-NONSDK: note: source target 'CycleKit' shadowing a Swift module with the same name at: '{{.*}}{{/|\\}}diagnose_dependency_cycle_shadow.swift.tmp{{/|\\}}inputs' // CHECK-NONSDK: note: source target 'CycleKit' shadowing a Swift module with the same name at: 'TMP_DIR{{/|\\}}inputs'
// SDK dependency shadowing // SDK dependency shadowing
// 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 // 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

View File

@@ -55,7 +55,7 @@
// 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 // 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
// CHECK: <unknown>:0: remark: importing module 'A' from {{.*}}{{/|\\}}explicit-module-map-clang-and-swift.swift.tmp{{/|\\}}inputs{{/|\\}}A.pcm' // CHECK: <unknown>:0: remark: importing module 'A' from 'TMP_DIR{{/|\\}}inputs{{/|\\}}A.pcm'
import A import A

View File

@@ -131,34 +131,34 @@ func testIndirect() { funcRedirectedIndirect() }
// CHECK: "-compile-module-from-interface" // CHECK: "-compile-module-from-interface"
// CHECK: "-ivfsoverlay", // CHECK: "-ivfsoverlay",
// CHECK-NEXT: "-Xcc", // CHECK-NEXT: "-Xcc",
// CHECK-NEXT: "{{.*}}{{/|\\}}preserve_used_vfs.swift.tmp{{/|\\}}overlay.yaml", // CHECK-NEXT: "TMP_DIR{{/|\\}}overlay.yaml",
// CHECK-NEXT: "-Xcc", // CHECK-NEXT: "-Xcc",
// CHECK-NEXT: "-ivfsoverlay", // CHECK-NEXT: "-ivfsoverlay",
// CHECK-NEXT: "-Xcc", // CHECK-NEXT: "-Xcc",
// CHECK-NEXT: "{{.*}}{{/|\\}}preserve_used_vfs.swift.tmp{{/|\\}}overlay-2.yaml", // CHECK-NEXT: "TMP_DIR{{/|\\}}overlay-2.yaml",
// CHECK: ], // CHECK: ],
/// --------Clang module F /// --------Clang module F
// CHECK-LABEL: "modulePath": "{{.*}}{{/|\\}}F-{{.*}}.pcm", // CHECK-LABEL: "modulePath": "{{.*}}{{/|\\}}F-{{.*}}.pcm",
// CHECK: "commandLine": [ // CHECK: "commandLine": [
// CHECK: "-vfsoverlay", // CHECK: "-vfsoverlay",
// CHECK-NEXT: "{{.*}}{{/|\\}}preserve_used_vfs.swift.tmp{{/|\\}}overlay.yaml", // CHECK-NEXT: "TMP_DIR{{/|\\}}overlay.yaml",
// CHECK-NEXT: "-vfsoverlay", // CHECK-NEXT: "-vfsoverlay",
// CHECK-NEXT: "{{.*}}{{/|\\}}preserve_used_vfs.swift.tmp{{/|\\}}overlay-2.yaml", // CHECK-NEXT: "TMP_DIR{{/|\\}}overlay-2.yaml",
// CHECK: "-ivfsoverlay", // CHECK: "-ivfsoverlay",
// CHECK-NEXT: "-Xcc", // CHECK-NEXT: "-Xcc",
// CHECK-NEXT: "{{.*}}{{/|\\}}preserve_used_vfs.swift.tmp{{/|\\}}overlay.yaml", // CHECK-NEXT: "TMP_DIR{{/|\\}}overlay.yaml",
// CHECK-NEXT: "-Xcc", // CHECK-NEXT: "-Xcc",
// CHECK-NEXT: "-ivfsoverlay", // CHECK-NEXT: "-ivfsoverlay",
// CHECK-NEXT: "-Xcc", // CHECK-NEXT: "-Xcc",
// CHECK-NEXT: "{{.*}}{{/|\\}}preserve_used_vfs.swift.tmp{{/|\\}}overlay-2.yaml", // CHECK-NEXT: "TMP_DIR{{/|\\}}overlay-2.yaml",
// CHECK: ] // CHECK: ]
/// --------Clang module Indirect /// --------Clang module Indirect
// CHECK-LABEL: "modulePath": "{{.*}}{{/|\\}}Indirect-{{.*}}.pcm", // CHECK-LABEL: "modulePath": "{{.*}}{{/|\\}}Indirect-{{.*}}.pcm",
// CHECK-NOT: overlay.yaml // CHECK-NOT: overlay.yaml
// CHECK: "-vfsoverlay", // CHECK: "-vfsoverlay",
// CHECK-NEXT: "{{.*}}{{/|\\}}preserve_used_vfs.swift.tmp{{/|\\}}overlay-2.yaml", // CHECK-NEXT: "TMP_DIR{{/|\\}}overlay-2.yaml",
// CHECK: "-ivfsoverlay", // CHECK: "-ivfsoverlay",
// CHECK-NEXT: "-Xcc", // CHECK-NEXT: "-Xcc",
// CHECK-NEXT: "{{.*}}{{/|\\}}preserve_used_vfs.swift.tmp{{/|\\}}overlay-2.yaml", // CHECK-NEXT: "TMP_DIR{{/|\\}}overlay-2.yaml",

View File

@@ -10,6 +10,6 @@
// Ensure we the modules' output path is set to the module cache // Ensure we the modules' output path is set to the module cache
// CHECK-DEPS: "swift": "A" // CHECK-DEPS: "swift": "A"
// CHECK-DEPS: "swift": "A" // CHECK-DEPS: "swift": "A"
// CHECK-DEPS: "modulePath": "{{.*}}separate_clang_scan_cache.swift.tmp.module-cache{{/|\\\\}}A-{{.*}}.swiftmodule" // CHECK-DEPS: "modulePath": "TMP_DIR.module-cache{{/|\\\\}}A-{{.*}}.swiftmodule"
import A import A

View File

@@ -14,12 +14,12 @@
// CHECK-DEPS: "clang": "F" // CHECK-DEPS: "clang": "F"
// CHECK-DEPS-NEXT: }, // CHECK-DEPS-NEXT: },
// CHECK-DEPS-NEXT: { // CHECK-DEPS-NEXT: {
// CHECK-DEPS-NEXT: "modulePath": "{{.*}}separate_clang_scan_cache_bridging.swift.tmp.module-cache{{/|\\\\}}F-{{.*}}.pcm" // CHECK-DEPS-NEXT: "modulePath": "TMP_DIR.module-cache{{/|\\\\}}F-{{.*}}.pcm"
// CHECK-DEPS: "swift": "A" // CHECK-DEPS: "swift": "A"
// CHECK-DEPS-NEXT: }, // CHECK-DEPS-NEXT: },
// CHECK-DEPS-NEXT: { // CHECK-DEPS-NEXT: {
// CHECK-DEPS-NEXT: "modulePath": "{{.*}}separate_clang_scan_cache_bridging.swift.tmp.module-cache{{/|\\\\}}A-{{.*}}.swiftmodule" // CHECK-DEPS-NEXT: "modulePath": "TMP_DIR.module-cache{{/|\\\\}}A-{{.*}}.swiftmodule"

View File

@@ -17,7 +17,7 @@ struct Foo {
// CHECK: indexstore_multifile.o-{{.*}} // CHECK: indexstore_multifile.o-{{.*}}
// CHECK: module-name: indexstoremodule // CHECK: module-name: indexstoremodule
// CHECK: main-path: SOURCE_DIR{{/|\\}}test{{/|\\}}SourceKit{{/|\\}}Indexing{{/|\\}}indexstore_multifile.swift // CHECK: main-path: SOURCE_DIR{{/|\\}}test{{/|\\}}SourceKit{{/|\\}}Indexing{{/|\\}}indexstore_multifile.swift
// CHECK: out-file: BUILD_DIR{{.*}}indexstore_multifile.o // CHECK: out-file: TMP_DIR{{/|\\}}indexstore_multifile.o
// CHECK: is-debug: 1 // CHECK: is-debug: 1
// CHECK: Unit | system | Swift | {{.*}}{{/|\\}}Swift.swiftmodule // CHECK: Unit | system | Swift | {{.*}}{{/|\\}}Swift.swiftmodule
// CHECK: Record | user | SOURCE_DIR{{/|\\}}test{{/|\\}}SourceKit{{/|\\}}Indexing{{/|\\}}indexstore_multifile.swift | indexstore_multifile.swift-{{.*}} // CHECK: Record | user | SOURCE_DIR{{/|\\}}test{{/|\\}}SourceKit{{/|\\}}Indexing{{/|\\}}indexstore_multifile.swift | indexstore_multifile.swift-{{.*}}