Skip to content

Commit 9fa286b

Browse files
[TEST] Switch to use new swift-driver when running tests
Default to use new swift-driver to run lit tests as legacy swift driver is deprecated for a long time. The lit tests for legacy drivers are also disable when running new swift-driver. Tests that relies on legacy swift driver (for example, tests merge module) can be enabled on conditions `legacy_swift_driver`. Fix and split up some existing tests that relies on legacy driver.
1 parent efdd008 commit 9fa286b

23 files changed

+173
-53
lines changed

test/ClangImporter/pch-bridging-header-vs-modular-interface-defn.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
// RUN: rm -rf %t
7878
// RUN: mkdir -p %t/Headers/Simple
7979
// RUN: ln -s %S/Inputs/frameworks/Simple.framework/Headers/Simple.h %t/Headers/Simple/Simple.h
80-
// RUN: %target-build-swift -emit-module -module-name test -Xfrontend -enable-objc-interop -Xfrontend -disable-deserialization-recovery -v -F %S/Inputs/frameworks -Xcc "-I%t/Headers" -module-cache-path %t/clang-module-cache -import-objc-header %S/Inputs/pch-bridging-header-with-non-modular-import.h %S/Inputs/other.swift %s
80+
// RUN: %target-build-swift -emit-module -module-name test -Xfrontend -enable-objc-interop -Xfrontend -disable-deserialization-recovery -v -F %S/Inputs/frameworks -Xcc -I -Xcc %t/Headers -module-cache-path %t/clang-module-cache -import-objc-header %S/Inputs/pch-bridging-header-with-non-modular-import.h %S/Inputs/other.swift %s
8181

8282
import Simple
8383
class Foo: SimpleProtocol {

test/ClangImporter/pch-bridging-header-with-another-bridging-header.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %target-build-swift -emit-module -disable-bridging-pch -import-objc-header %S/Inputs/pch-bridging-header-with-another-bridging-header/app.h -I %S/Inputs/pch-bridging-header-with-another-bridging-header -module-name App -emit-module-path %t/App.swiftmodule %S/../Inputs/empty.swift
33
// RUN: llvm-bcanalyzer -dump %t/App.swiftmodule | %FileCheck %s
44

5-
// CHECK: IMPORTED_HEADER{{.*}}Inputs/pch-bridging-header-with-another-bridging-header/app.h
5+
// CHECK: IMPORTED_HEADER{{.*}}Inputs{{/|\\}}pch-bridging-header-with-another-bridging-header{{/|\\}}app.h
66

77
// Now load the app-module-with-bridging-header along with another bridging
88
// header that we precompile. This is going to the frontend directly to make

test/ClangImporter/pcm-emit-and-import.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
// Verify some of the output of the -dump-pcm flag.
66
// RUN: %swift-dump-pcm %t/script.pcm | %FileCheck %s --check-prefix=CHECK-DUMP
7-
// CHECK-DUMP: Information for module file '{{.*}}/script.pcm':
7+
// CHECK-DUMP: Information for module file '{{.*}}{{[/|\\]}}script.pcm':
88
// CHECK-DUMP: Module name: script
9-
// CHECK-DUMP: Module map file: {{.*[/\\]}}Inputs{{/|\\}}custom-modules{{/|\\}}module.modulemap
9+
// CHECK-DUMP: Module map file: {{.*}}Inputs{{/|\\}}custom-modules{{/|\\}}module.modulemap
1010

1111
// Compile a source file that imports the explicit module.
1212
// RUN: %target-swift-frontend -typecheck -verify -Xcc -fmodule-file=%t/script.pcm %s

test/ClangImporter/pcm-emit-direct-cc1-mode.swift

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

55
// Verify some of the output of the -dump-pcm flag.
66
// RUN: %swift-dump-pcm %t/script.pcm | %FileCheck %s --check-prefix=CHECK-DUMP
7-
// CHECK-DUMP: Information for module file '{{.*}}/script.pcm':
7+
// CHECK-DUMP: Information for module file '{{.*}}{{[/|\\]}}script.pcm':
88
// CHECK-DUMP: Module name: script
99
// CHECK-DUMP: Module map file: {{.*[/\\]}}Inputs{{/|\\}}custom-modules{{/|\\}}module.modulemap
1010

test/DebugInfo/ASTSection-single.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
// RUN: %target-swift-modulewrap %t/a0.swiftmodule -o %t/a0-mod.o
1111

1212
// RUN: %lldb-moduleimport-test -verbose %t/a0-mod.o | %FileCheck %s
13-
// CHECK: Path: {{.*}}/Inputs, framework=false, system=false
13+
// CHECK: Path: {{.*}}{{/|\\}}Inputs, framework=false, system=false
1414
// CHECK: Importing a0...
1515
// CHECK: Import successful!

test/DebugInfo/module-compilation-dir.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
// RUN: %target-swift-emit-pcm -g -module-name Macro -o %t/Macro.pcm -file-compilation-dir /compdir %S/Inputs/module.modulemap
44
// RUN: %llvm-dwarfdump %t/Macro.pcm | %FileCheck %s
55

6-
// CHECK: DW_AT_comp_dir ("/compdir")
6+
// CHECK: DW_AT_comp_dir ("{{/|\\}}compdir")

test/Driver/lit.local.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
if not 'legacy_swift_driver' in config.available_features:
2+
config.unsupported = True

test/IDE/local_types.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// Avoid emitting the module separately since that would skip non-inlinable
44
// function bodies without types, and we want to print the decls in
55
// `singleDefaultArgument`.
6+
// REQUIRES: legacy_swift_driver
67
// RUN: %empty-directory(%t)
78
// RUN: %target-swiftc_driver -v -no-emit-module-separately -emit-module -module-name LocalTypes -o %t/LocalTypes.swiftmodule %s
89
// RUN: %target-swift-ide-test -print-local-types -I %t -module-to-print LocalTypes -source-filename %s > %t.dump

test/IDE/merge_local_types.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Tests merging of modules each with their own local types
22

3+
// REQUIRES: legacy_swift_driver
34
// RUN: %empty-directory(%t)
45

56
// Create separate modules and merge them together

test/Index/Store/driver-include-locals.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
// RUN: %target-swiftc_driver -driver-print-jobs -emit-object -index-ignore-system-modules -index-store-path %t/index_store -o %t/file.o %s | %FileCheck -check-prefix=JOBS %s
88
// RUN: %target-swiftc_driver -driver-print-jobs -emit-object -index-ignore-system-modules -index-include-locals -index-store-path %t/index_store -o %t/file.o %s | %FileCheck -check-prefix=LOCAL-JOBS %s
9-
// JOBS-NOT: {{.*}}swift{{(c|c-legacy-driver|-frontend)?(\.exe)?"?}} -frontend {{.*}}-index-store-path {{.*}}/index_store{{"?}} -index-include-locals
10-
// LOCAL-JOBS: {{.*}}swift{{(c|c-legacy-driver|-frontend)?(\.exe)?"?}} -frontend {{.*}}-index-store-path {{.*}}/index_store{{"?}} -index-include-locals
9+
// JOBS-NOT: {{.*}}swift{{(c|c-legacy-driver|-frontend)?(\.exe)?"?}} -frontend {{.*}}-index-store-path {{.*}}{{/|\\}}index_store{{"?}} -index-include-locals
10+
// LOCAL-JOBS: {{.*}}swift{{(c|c-legacy-driver|-frontend)?(\.exe)?"?}} -frontend {{.*}}-index-store-path {{.*}}{{/|\\}}index_store{{"?}} -index-include-locals
1111
//
1212
// Verify the frontend actually generates local index data:
1313
//

0 commit comments

Comments
 (0)