@@ -7029,14 +7029,34 @@ final class SwiftDriverTests: XCTestCase {
70297029 try testInputsPath. appending ( component: " mock-sdk.sdk " ) . nativePathString ( escaped: false )
70307030
70317031 do {
7032- var driver = try Driver ( args: [ " swiftc " , " -target " , " x86_64-apple-ios13.1-macabi " , " foo.swift " , " -sdk " , mockSDKPath] ,
7032+ let resourceDirPath : String = try testInputsPath. appending ( components: " PrebuiltModules-macOS10.15.xctoolchain " , " usr " , " lib " , " swift " ) . nativePathString ( escaped: false )
7033+
7034+ var driver = try Driver ( args: [ " swiftc " , " -target " , " x86_64-apple-ios13.1-macabi " , " foo.swift " , " -sdk " , mockSDKPath, " -resource-dir " , resourceDirPath] ,
7035+ env: envVars)
7036+ let plannedJobs = try driver. planBuild ( )
7037+ let job = plannedJobs [ 0 ]
7038+ XCTAssertTrue ( job. commandLine. contains ( . flag( " -prebuilt-module-cache-path " ) ) )
7039+ XCTAssertTrue ( job. commandLine. contains { arg in
7040+ if case . path( let curPath) = arg {
7041+ if curPath. basename == " 10.15 " && curPath. parentDirectory. basename == " prebuilt-modules " && curPath. parentDirectory. parentDirectory. basename == " macosx " {
7042+ return true
7043+ }
7044+ }
7045+ return false
7046+ } )
7047+ }
7048+
7049+ do {
7050+ let resourceDirPath : String = try testInputsPath. appending ( components: " PrebuiltModules-macOSUnversioned.xctoolchain " , " usr " , " lib " , " swift " ) . nativePathString ( escaped: false )
7051+
7052+ var driver = try Driver ( args: [ " swiftc " , " -target " , " x86_64-apple-ios13.1-macabi " , " foo.swift " , " -sdk " , mockSDKPath, " -resource-dir " , resourceDirPath] ,
70337053 env: envVars)
70347054 let plannedJobs = try driver. planBuild ( )
70357055 let job = plannedJobs [ 0 ]
70367056 XCTAssertTrue ( job. commandLine. contains ( . flag( " -prebuilt-module-cache-path " ) ) )
70377057 XCTAssertTrue ( job. commandLine. contains { arg in
70387058 if case . path( let curPath) = arg {
7039- if curPath. basename == " 10.15 " && curPath. parentDirectory. basename == " prebuilt-modules " {
7059+ if curPath. basename == " prebuilt-modules " && curPath. parentDirectory. basename == " macosx " {
70407060 return true
70417061 }
70427062 }
0 commit comments