@@ -7029,14 +7029,34 @@ final class SwiftDriverTests: XCTestCase {
7029
7029
try testInputsPath. appending ( component: " mock-sdk.sdk " ) . nativePathString ( escaped: false )
7030
7030
7031
7031
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] ,
7033
7053
env: envVars)
7034
7054
let plannedJobs = try driver. planBuild ( )
7035
7055
let job = plannedJobs [ 0 ]
7036
7056
XCTAssertTrue ( job. commandLine. contains ( . flag( " -prebuilt-module-cache-path " ) ) )
7037
7057
XCTAssertTrue ( job. commandLine. contains { arg in
7038
7058
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 " {
7040
7060
return true
7041
7061
}
7042
7062
}
0 commit comments