@@ -6780,8 +6780,14 @@ final class SwiftDriverTests: XCTestCase {
6780
6780
}
6781
6781
6782
6782
func testPluginPaths( ) throws {
6783
- let sdkRoot = testInputsPath. appending ( component: " SDKChecks " ) . appending ( component: " iPhoneOS.sdk " )
6784
- var driver = try Driver ( args: [ " swiftc " , " -typecheck " , " foo.swift " , " -sdk " , VirtualPath . absolute ( sdkRoot) . name, " -plugin-path " , " PluginA " , " -external-plugin-path " , " PluginB#Bexe " , " -load-plugin-library " , " PluginB2 " , " -plugin-path " , " PluginC " ] )
6783
+ try pluginPathTest ( platform: " iPhoneOS " , sdk: " iPhoneOS13.0 " , searchPlatform: " iPhoneOS " )
6784
+ try pluginPathTest ( platform: " iPhoneSimulator " , sdk: " iPhoneSimulator15.0 " , searchPlatform: " iPhoneOS " )
6785
+ }
6786
+
6787
+ func pluginPathTest( platform: String , sdk: String , searchPlatform: String ) throws {
6788
+ let sdkRoot = testInputsPath. appending (
6789
+ components: [ " Platform Checks " , " \( platform) .platform " , " Developer " , " SDKs " , " \( sdk) .sdk " ] )
6790
+ var driver = try Driver ( args: [ " swiftc " , " -typecheck " , " foo.swift " , " -sdk " , VirtualPath . absolute ( sdkRoot) . name, " -plugin-path " , " PluginA " , " -external-plugin-path " , " Plugin~B#Bexe " , " -load-plugin-library " , " PluginB2 " , " -plugin-path " , " PluginC " ] )
6785
6791
guard driver. isFrontendArgSupported ( . pluginPath) && driver. isFrontendArgSupported ( . externalPluginPath) else {
6786
6792
return
6787
6793
}
@@ -6794,7 +6800,7 @@ final class SwiftDriverTests: XCTestCase {
6794
6800
let pluginAIndex = job. commandLine. firstIndex ( of: . path( VirtualPath . relative ( . init( " PluginA " ) ) ) )
6795
6801
XCTAssertNotNil ( pluginAIndex)
6796
6802
6797
- let pluginBIndex = job. commandLine. firstIndex ( of: . path( VirtualPath . relative ( . init( " PluginB #Bexe" ) ) ) )
6803
+ let pluginBIndex = job. commandLine. firstIndex ( of: . path( VirtualPath . relative ( . init( " Plugin~B #Bexe" ) ) ) )
6798
6804
XCTAssertNotNil ( pluginBIndex)
6799
6805
XCTAssertLessThan ( pluginAIndex!, pluginBIndex!)
6800
6806
@@ -6820,7 +6826,11 @@ final class SwiftDriverTests: XCTestCase {
6820
6826
XCTAssertNotNil ( sdkLocalPluginPathIndex)
6821
6827
XCTAssertLessThan ( sdkPluginPathIndex!, sdkLocalPluginPathIndex!)
6822
6828
6823
- let platformPath = sdkRoot. parentDirectory. parentDirectory. parentDirectory. appending ( components: " Developer " , " usr " )
6829
+ let origPlatformPath =
6830
+ sdkRoot. parentDirectory. parentDirectory. parentDirectory. parentDirectory
6831
+ . appending ( component: " \( searchPlatform) .platform " )
6832
+
6833
+ let platformPath = origPlatformPath. appending ( components: " Developer " , " usr " )
6824
6834
let platformServerPath = platformPath. appending ( components: " bin " , " swift-plugin-server " ) . pathString
6825
6835
6826
6836
let platformPluginPath = platformPath. appending ( components: " lib " , " swift " , " host " , " plugins " )
0 commit comments