|
1 | 1 | /// Test the -module-alias flag with the following scenario:
|
2 |
| -/// Module 'Utils' imports module 'AppleLogging', and module 'UserN' imports both 'Utils' and 'Logging'. |
3 |
| -/// 'Logging' can be aliased 'AppleLogging' via -module-alias. |
| 2 | +/// Module 'Utils' imports module 'LoggingApple', and module 'UserN' imports both 'Utils' and 'Logging'. |
| 3 | +/// 'Logging' can be aliased 'LoggingApple' via -module-alias. |
4 | 4 |
|
5 | 5 | // RUN: %empty-directory(%t)
|
6 | 6 |
|
|
12 | 12 | /// Check Logging.swiftmodule is created
|
13 | 13 | // RUN: test -f %t/Logging.swiftmodule
|
14 | 14 |
|
15 |
| -/// Create AppleLogging.swiftmodule |
| 15 | +/// Create LoggingApple.swiftmodule |
16 | 16 | // RUN: echo 'public struct Logger { }' > %t/FileAppleLog.swift
|
17 |
| -// RUN: echo 'public func setup() -> AppleLogging.Logger? { return nil }' >> %t/FileAppleLog.swift |
18 |
| -// RUN: echo 'public func pie() -> AppleLogging.Logger? { return nil }' >> %t/FileAppleLog.swift |
19 |
| -// RUN: %target-swift-frontend -module-name AppleLogging %t/FileAppleLog.swift -emit-module -emit-module-path %t/AppleLogging.swiftmodule |
| 17 | +// RUN: echo 'public func setup() -> LoggingApple.Logger? { return nil }' >> %t/FileAppleLog.swift |
| 18 | +// RUN: echo 'public func pie() -> LoggingApple.Logger? { return nil }' >> %t/FileAppleLog.swift |
| 19 | +// RUN: %target-swift-frontend -module-name LoggingApple %t/FileAppleLog.swift -emit-module -emit-module-path %t/LoggingApple.swiftmodule |
20 | 20 |
|
21 |
| -/// Check AppleLogging.swiftmodule is created |
22 |
| -// RUN: test -f %t/AppleLogging.swiftmodule |
| 21 | +/// Check LoggingApple.swiftmodule is created |
| 22 | +// RUN: test -f %t/LoggingApple.swiftmodule |
23 | 23 |
|
24 |
| -/// Create a module Utils that imports AppleLogging |
25 |
| -// RUN: echo 'import AppleLogging' > %t/FileUtils.swift |
26 |
| -// RUN: echo 'public func start() { _ = AppleLogging.setup() }' >> %t/FileUtils.swift |
| 24 | +/// Create a module Utils that imports LoggingApple |
| 25 | +// RUN: echo 'import LoggingApple' > %t/FileUtils.swift |
| 26 | +// RUN: echo 'public func start() { _ = LoggingApple.setup() }' >> %t/FileUtils.swift |
27 | 27 | // RUN: %target-swift-frontend -module-name Utils %t/FileUtils.swift -I %t -emit-module -emit-module-path %t/Utils.swiftmodule -Rmodule-loading 2> %t/result-Utils.output
|
28 | 28 |
|
29 |
| -/// Check Utils.swiftmodule is created and AppleLogging.swiftmodule is loaded |
| 29 | +/// Check Utils.swiftmodule is created and LoggingApple.swiftmodule is loaded |
30 | 30 | // RUN: test -f %t/Utils.swiftmodule
|
31 | 31 | // RUN: %FileCheck %s -input-file %t/result-Utils.output -check-prefix CHECK-UTILS
|
32 |
| -// CHECK-UTILS: remark: loaded module at {{.*}}/AppleLogging.swiftmodule |
| 32 | +// CHECK-UTILS: remark: loaded module at {{.*}}LoggingApple.swiftmodule |
33 | 33 |
|
34 | 34 | /// Create a module User1 that imports both Utils and Logging, without module aliasing for Logging
|
35 | 35 | // RUN: echo 'import Logging' > %t/File.swift
|
|
41 | 41 | /// Check User1.swiftmodule is created and Utils.swiftmodule and Logging.swiftmodule are loaded
|
42 | 42 | // RUN: test -f %t/User1.swiftmodule
|
43 | 43 | // RUN: %FileCheck %s -input-file %t/result-User1.output -check-prefix CHECK-1
|
44 |
| -// CHECK-1: remark: loaded module at {{.*}}/Logging.swiftmodule |
45 |
| -// CHECK-1: remark: loaded module at {{.*}}/Utils.swiftmodule |
| 44 | +// CHECK-1: remark: loaded module at {{.*}}Logging.swiftmodule |
| 45 | +// CHECK-1: remark: loaded module at {{.*}}Utils.swiftmodule |
46 | 46 |
|
47 | 47 | /// Create a module User2 that imports both Utils and Logging, with module aliasing for Logging
|
48 | 48 | // RUN: echo 'import Logging' > %t/File.swift
|
49 | 49 | // RUN: echo 'import Utils' >> %t/File.swift
|
50 | 50 | // RUN: echo 'public func runUtils() { Utils.start() }' >> %t/File.swift
|
51 | 51 | // RUN: echo 'public func runLog() { _ = Logging.setup() }' >> %t/File.swift
|
52 |
| -// RUN: %target-swift-frontend -module-name User2 -module-alias Logging=AppleLogging %t/File.swift -I %t -emit-module -emit-module-path %t/User2.swiftmodule -Rmodule-loading 2> %t/result-User2.output |
| 52 | +// RUN: %target-swift-frontend -module-name User2 -module-alias Logging=LoggingApple %t/File.swift -I %t -emit-module -emit-module-path %t/User2.swiftmodule -Rmodule-loading 2> %t/result-User2.output |
53 | 53 |
|
54 |
| -/// Check User2.swiftmodule is created and Utils.swiftmodule and AppleLogging.swiftmodule are loaded but |
| 54 | +/// Check User2.swiftmodule is created and Utils.swiftmodule and LoggingApple.swiftmodule are loaded but |
55 | 55 | /// Logging.swiftmodule is not loaded.
|
56 | 56 | // RUN: test -f %t/User2.swiftmodule
|
57 | 57 | // RUN: %FileCheck %s -input-file %t/result-User2.output -check-prefix CHECK-2A
|
58 |
| -// CHECK-2A: remark: loaded module at {{.*}}/AppleLogging.swiftmodule |
59 |
| -// CHECK-2A: remark: loaded module at {{.*}}/Utils.swiftmodule |
| 58 | +// CHECK-2A: remark: loaded module at {{.*}}LoggingApple.swiftmodule |
| 59 | +// CHECK-2A: remark: loaded module at {{.*}}Utils.swiftmodule |
60 | 60 | // RUN: not %FileCheck %s -input-file %t/result-User2.output -check-prefix CHECK-2B
|
61 |
| -// CHECK-2B: remark: loaded module at {{.*}}/Logging.swiftmodule |
| 61 | +// CHECK-2B: remark: loaded module at {{.*}}Logging.swiftmodule |
0 commit comments