@@ -7188,14 +7188,34 @@ final class SwiftDriverTests: XCTestCase {
7188
7188
try testInputsPath. appending ( component: " mock-sdk.sdk " ) . nativePathString ( escaped: false )
7189
7189
7190
7190
do {
7191
- var driver = try Driver ( args: [ " swiftc " , " -target " , " x86_64-apple-ios13.1-macabi " , " foo.swift " , " -sdk " , mockSDKPath] ,
7191
+ let resourceDirPath : String = try testInputsPath. appending ( components: " PrebuiltModules-macOS10.15.xctoolchain " , " usr " , " lib " , " swift " ) . nativePathString ( escaped: false )
7192
+
7193
+ var driver = try Driver ( args: [ " swiftc " , " -target " , " x86_64-apple-ios13.1-macabi " , " foo.swift " , " -sdk " , mockSDKPath, " -resource-dir " , resourceDirPath] ,
7194
+ env: envVars)
7195
+ let plannedJobs = try driver. planBuild ( )
7196
+ let job = plannedJobs [ 0 ]
7197
+ XCTAssertTrue ( job. commandLine. contains ( . flag( " -prebuilt-module-cache-path " ) ) )
7198
+ XCTAssertTrue ( job. commandLine. contains { arg in
7199
+ if case . path( let curPath) = arg {
7200
+ if curPath. basename == " 10.15 " && curPath. parentDirectory. basename == " prebuilt-modules " && curPath. parentDirectory. parentDirectory. basename == " macosx " {
7201
+ return true
7202
+ }
7203
+ }
7204
+ return false
7205
+ } )
7206
+ }
7207
+
7208
+ do {
7209
+ let resourceDirPath : String = try testInputsPath. appending ( components: " PrebuiltModules-macOSUnversioned.xctoolchain " , " usr " , " lib " , " swift " ) . nativePathString ( escaped: false )
7210
+
7211
+ var driver = try Driver ( args: [ " swiftc " , " -target " , " x86_64-apple-ios13.1-macabi " , " foo.swift " , " -sdk " , mockSDKPath, " -resource-dir " , resourceDirPath] ,
7192
7212
env: envVars)
7193
7213
let plannedJobs = try driver. planBuild ( )
7194
7214
let job = plannedJobs [ 0 ]
7195
7215
XCTAssertTrue ( job. commandLine. contains ( . flag( " -prebuilt-module-cache-path " ) ) )
7196
7216
XCTAssertTrue ( job. commandLine. contains { arg in
7197
7217
if case . path( let curPath) = arg {
7198
- if curPath. basename == " 10.15 " && curPath. parentDirectory. basename == " prebuilt-modules " {
7218
+ if curPath. basename == " prebuilt-modules " && curPath. parentDirectory. basename == " macosx " {
7199
7219
return true
7200
7220
}
7201
7221
}
0 commit comments