@@ -6869,8 +6869,14 @@ final class SwiftDriverTests: XCTestCase {
68696869 }
68706870
68716871 func testPluginPaths( ) throws {
6872- let sdkRoot = testInputsPath. appending ( component: " SDKChecks " ) . appending ( component: " iPhoneOS.sdk " )
6873- 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 " ] )
6872+ try pluginPathTest ( platform: " iPhoneOS " , sdk: " iPhoneOS13.0 " , searchPlatform: " iPhoneOS " )
6873+ try pluginPathTest ( platform: " iPhoneSimulator " , sdk: " iPhoneSimulator15.0 " , searchPlatform: " iPhoneOS " )
6874+ }
6875+
6876+ func pluginPathTest( platform: String , sdk: String , searchPlatform: String ) throws {
6877+ let sdkRoot = testInputsPath. appending (
6878+ components: [ " Platform Checks " , " \( platform) .platform " , " Developer " , " SDKs " , " \( sdk) .sdk " ] )
6879+ 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 " ] )
68746880 guard driver. isFrontendArgSupported ( . pluginPath) && driver. isFrontendArgSupported ( . externalPluginPath) else {
68756881 return
68766882 }
@@ -6883,7 +6889,7 @@ final class SwiftDriverTests: XCTestCase {
68836889 let pluginAIndex = job. commandLine. firstIndex ( of: . path( VirtualPath . relative ( . init( " PluginA " ) ) ) )
68846890 XCTAssertNotNil ( pluginAIndex)
68856891
6886- let pluginBIndex = job. commandLine. firstIndex ( of: . path( VirtualPath . relative ( . init( " PluginB #Bexe" ) ) ) )
6892+ let pluginBIndex = job. commandLine. firstIndex ( of: . path( VirtualPath . relative ( . init( " Plugin~B #Bexe" ) ) ) )
68876893 XCTAssertNotNil ( pluginBIndex)
68886894 XCTAssertLessThan ( pluginAIndex!, pluginBIndex!)
68896895
@@ -6909,7 +6915,11 @@ final class SwiftDriverTests: XCTestCase {
69096915 XCTAssertNotNil ( sdkLocalPluginPathIndex)
69106916 XCTAssertLessThan ( sdkPluginPathIndex!, sdkLocalPluginPathIndex!)
69116917
6912- let platformPath = sdkRoot. parentDirectory. parentDirectory. parentDirectory. appending ( components: " Developer " , " usr " )
6918+ let origPlatformPath =
6919+ sdkRoot. parentDirectory. parentDirectory. parentDirectory. parentDirectory
6920+ . appending ( component: " \( searchPlatform) .platform " )
6921+
6922+ let platformPath = origPlatformPath. appending ( components: " Developer " , " usr " )
69136923 let platformServerPath = platformPath. appending ( components: " bin " , " swift-plugin-server " ) . pathString
69146924
69156925 let platformPluginPath = platformPath. appending ( components: " lib " , " swift " , " host " , " plugins " )
0 commit comments