Skip to content

Commit 0cad63e

Browse files
committed
Clean up a test
1 parent c369a96 commit 0cad63e

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed
Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
11
/// Test the -module-alias flag with an explicit module loader.
22

33
// RUN: %empty-directory(%t)
4+
// RUN: mkdir -p %t/inputs
5+
// RUN: mkdir -p %t/outputs
46

57
/// Create a module Bar
6-
// RUN: echo 'public func bar() {}' > %t/FileBar.swift
7-
// RUN: %target-swift-frontend -module-name Bar %t/FileBar.swift -emit-module -emit-module-path %t/Bar.swiftmodule
8+
// RUN: echo 'public func bar() {}' > %t/inputs/FileBar.swift
9+
// RUN: %target-swift-frontend -module-name Bar %t/inputs/FileBar.swift -emit-module -emit-module-path %t/inputs/Bar.swiftmodule
810

911
/// Check Bar.swiftmodule is created
10-
// RUN: test -f %t/Bar.swiftmodule
12+
// RUN: test -f %t/inputs/Bar.swiftmodule
1113

1214
/// Next create an explicit module dependency map to build module Foo
13-
// RUN: mkdir -p %t/inputs
14-
// RUN: echo 'import Cat' > %t/FileFoo.swift
15+
// RUN: echo 'import Cat' > %t/inputs/FileFoo.swift
1516

1617
// RUN: echo "[{" > %/t/inputs/map.json
17-
// RUN: echo "\"moduleName\": \"Foo\"," >> %/t/inputs/map.json
18-
// RUN: echo "\"modulePath\": \"%/t/inputs/Foo.swiftmodule\"," >> %/t/inputs/map.json
19-
// RUN: echo "\"docPath\": \"%/t/inputs/Foo.swiftdoc\"," >> %/t/inputs/map.json
20-
// RUN: echo "\"sourceInfoPath\": \"%/t/inputs/Foo.swiftsourceinfo\"," >> %/t/inputs/map.json
21-
// RUN: echo "\"isFramework\": false" >> %/t/inputs/map.json
22-
// RUN: echo "}," >> %/t/inputs/map.json
23-
// RUN: echo "{" >> %/t/inputs/map.json
2418
// RUN: echo "\"moduleName\": \"Bar\"," >> %/t/inputs/map.json
25-
// RUN: echo "\"modulePath\": \"%t/Bar.swiftmodule\"," >> %/t/inputs/map.json
19+
// RUN: echo "\"modulePath\": \"%/t/inputs/Bar.swiftmodule\"," >> %/t/inputs/map.json
2620
// RUN: echo "\"isFramework\": false" >> %/t/inputs/map.json
2721
// RUN: echo "}," >> %/t/inputs/map.json
2822
// RUN: echo "{" >> %/t/inputs/map.json
@@ -42,12 +36,12 @@
4236
// RUN: echo "}]" >> %/t/inputs/map.json
4337

4438
/// Create a module Foo that imports Cat with -module-alias Cat=Bar with an explicit module loader
45-
// RUN: %target-swift-frontend -module-name Foo %t/FileFoo.swift -module-alias Cat=Bar -I %t -emit-module -emit-module-path %t/Foo.swiftmodule -disable-implicit-swift-modules -explicit-swift-module-map-file %t/inputs/map.json -Rmodule-loading 2> %t/load-result.output
39+
// RUN: %target-swift-frontend -module-name Foo %t/inputs/FileFoo.swift -module-alias Cat=Bar -I %t/inputs -emit-module -emit-module-path %t/outputs/Foo.swiftmodule -disable-implicit-swift-modules -explicit-swift-module-map-file %t/inputs/map.json -Rmodule-loading 2> %t/outputs/load-result.output
4640

47-
// RUN: test -f %t/Foo.swiftmodule
48-
// RUN: test -f %t/Bar.swiftmodule
49-
// RUN: not test -f %t/Cat.swiftmodule
41+
// RUN: test -f %t/outputs/Foo.swiftmodule
42+
// RUN: test -f %t/inputs/Bar.swiftmodule
43+
// RUN: not test -f %t/inputs/Cat.swiftmodule
5044

51-
// RUN: %FileCheck %s -input-file %t/load-result.output -check-prefix CHECK
45+
// RUN: %FileCheck %s -input-file %t/outputs/load-result.output -check-prefix CHECK
5246
// CHECK: remark: loaded module at {{.*}}Bar.swiftmodule
5347

0 commit comments

Comments
 (0)