Skip to content

Commit 2fd5178

Browse files
committed
[Sema|NFC] Update the style of the test ioi-suggestion
1 parent 99d9beb commit 2fd5178

File tree

1 file changed

+24
-25
lines changed

1 file changed

+24
-25
lines changed

test/Sema/implementation-only-import-suggestion.swift

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %empty-directory(%t)
2+
// RUN: split-file %s %t
23
// REQUIRES: VENDOR=apple
34
// REQUIRES: asserts
45

@@ -12,28 +13,28 @@
1213
// RUN: -o %t/sdk/System/Library/PrivateFrameworks/PrivateSwift.framework/Modules/PrivateSwift.swiftmodule/%target-swiftmodule-name
1314

1415
/// Expect errors when building a public client.
15-
// RUN: %target-swift-frontend -typecheck -sdk %t/sdk -module-cache-path %t %s \
16-
// RUN: -F %t/sdk/System/Library/PrivateFrameworks/ \
17-
// RUN: -library-level api -verify -D PUBLIC_IMPORTS -module-name MainLib
16+
// RUN: %target-swift-frontend -typecheck -sdk %t/sdk %t/PublicImports.swift \
17+
// RUN: -F %t/sdk/System/Library/PrivateFrameworks/ -module-cache-path %t \
18+
// RUN: -library-level api -verify -module-name MainLib
1819

1920
/// Expect no errors when building an SPI client.
20-
// RUN: %target-swift-frontend -typecheck -sdk %t/sdk -module-cache-path %t %s \
21-
// RUN: -F %t/sdk/System/Library/PrivateFrameworks/ \
22-
// RUN: -library-level spi -D PUBLIC_IMPORTS -module-name MainLib
21+
// RUN: %target-swift-frontend -typecheck -sdk %t/sdk %t/PublicImports.swift \
22+
// RUN: -F %t/sdk/System/Library/PrivateFrameworks/ -module-cache-path %t \
23+
// RUN: -library-level spi -module-name MainLib
2324

2425
/// The driver should also accept the flag and pass it along.
25-
// RUN: %target-swiftc_driver -typecheck -sdk %t/sdk -module-cache-path %t %s \
26-
// RUN: -F %t/sdk/System/Library/PrivateFrameworks/ \
27-
// RUN: -library-level spi -D PUBLIC_IMPORTS -module-name MainLib
26+
// RUN: %target-swiftc_driver -typecheck -sdk %t/sdk %t/PublicImports.swift \
27+
// RUN: -F %t/sdk/System/Library/PrivateFrameworks/ -module-cache-path %t \
28+
// RUN: -library-level spi -module-name MainLib
2829

2930
/// Expect no errors when building a client with some other library level.
30-
// RUN: %target-swift-frontend -typecheck -sdk %t/sdk -module-cache-path %t %s \
31-
// RUN: -F %t/sdk/System/Library/PrivateFrameworks/ \
32-
// RUN: -D PUBLIC_IMPORTS -module-name MainLib
33-
// RUN: %target-swift-frontend -typecheck -sdk %t/sdk -module-cache-path %t %s \
34-
// RUN: -F %t/sdk/System/Library/PrivateFrameworks/ \
35-
// RUN: -library-level other -D PUBLIC_IMPORTS -module-name MainLib
36-
#if PUBLIC_IMPORTS
31+
// RUN: %target-swift-frontend -typecheck -sdk %t/sdk %t/PublicImports.swift \
32+
// RUN: -F %t/sdk/System/Library/PrivateFrameworks/ -module-cache-path %t \
33+
// RUN: -module-name MainLib
34+
// RUN: %target-swift-frontend -typecheck -sdk %t/sdk %t/PublicImports.swift \
35+
// RUN: -F %t/sdk/System/Library/PrivateFrameworks/ -module-cache-path %t \
36+
// RUN: -library-level other -module-name MainLib
37+
//--- PublicImports.swift
3738
import PublicSwift
3839
import PrivateSwift // expected-error{{private module 'PrivateSwift' is imported publicly from the public module 'MainLib'}}
3940

@@ -44,30 +45,28 @@ import LocalClang // expected-error{{private module 'LocalClang' is imported pub
4445
@_exported import MainLib // expected-warning{{private module 'MainLib' is imported publicly from the public module 'MainLib'}}
4546

4647
/// Expect no errors with implementation-only imports.
47-
// RUN: %target-swift-frontend -typecheck -sdk %t/sdk -module-cache-path %t %s \
48-
// RUN: -F %t/sdk/System/Library/PrivateFrameworks/ \
48+
// RUN: %target-swift-frontend -typecheck -sdk %t/sdk %t/ImplOnlyImports.swift \
49+
// RUN: -F %t/sdk/System/Library/PrivateFrameworks/ -module-cache-path %t \
4950
// RUN: -library-level api -D IMPL_ONLY_IMPORTS
50-
#elseif IMPL_ONLY_IMPORTS
51+
//--- ImplOnlyImports.swift
5152

5253
@_implementationOnly import PrivateSwift
5354
@_implementationOnly import PublicClang_Private
5455
@_implementationOnly import FullyPrivateClang
5556
@_implementationOnly import LocalClang
5657

5758
/// Expect no errors with spi-only imports.
58-
// RUN: %target-swift-frontend -typecheck -sdk %t/sdk -module-cache-path %t %s \
59-
// RUN: -experimental-spi-only-imports \
59+
// RUN: %target-swift-frontend -typecheck -sdk %t/sdk %t/SpiOnlyImports.swift \
60+
// RUN: -experimental-spi-only-imports -module-cache-path %t \
6061
// RUN: -F %t/sdk/System/Library/PrivateFrameworks/ \
61-
// RUN: -library-level api -D SPI_ONLY_IMPORTS
62-
#elseif SPI_ONLY_IMPORTS
62+
// RUN: -library-level api
63+
//--- SPIOnlyImports.swift
6364

6465
@_spiOnly import PrivateSwift
6566
@_spiOnly import PublicClang_Private
6667
@_spiOnly import FullyPrivateClang
6768
@_spiOnly import LocalClang
6869

69-
#endif
70-
7170
/// Test error message on an unknown library level name.
7271
// RUN: not %target-swift-frontend -typecheck %s -library-level ThatsNotALibraryLevel 2>&1 \
7372
// RUN: | %FileCheck %s --check-prefix CHECK-ARG

0 commit comments

Comments
 (0)