@@ -7188,14 +7188,34 @@ final class SwiftDriverTests: XCTestCase {
71887188 try testInputsPath. appending ( component: " mock-sdk.sdk " ) . nativePathString ( escaped: false )
71897189
71907190 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] ,
71927212 env: envVars)
71937213 let plannedJobs = try driver. planBuild ( )
71947214 let job = plannedJobs [ 0 ]
71957215 XCTAssertTrue ( job. commandLine. contains ( . flag( " -prebuilt-module-cache-path " ) ) )
71967216 XCTAssertTrue ( job. commandLine. contains { arg in
71977217 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 " {
71997219 return true
72007220 }
72017221 }
0 commit comments