@@ -275,6 +275,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
275275 }
276276
277277 func testModuleDependencyBuildCommandUniqueDepFile( ) throws {
278+ let ( stdlibPath, shimsPath, _, _) = try getDriverArtifactsForScanning ( )
278279 try withTemporaryDirectory { path in
279280 let source0 = path. appending ( component: " testModuleDependencyBuildCommandUniqueDepFile1.swift " )
280281 let source1 = path. appending ( component: " testModuleDependencyBuildCommandUniqueDepFile2.swift " )
@@ -299,9 +300,10 @@ final class ExplicitModuleBuildTests: XCTestCase {
299300 . appending ( component: " Swift " )
300301 let sdkArgumentsForTesting = ( try ? Driver . sdkArgumentsForTesting ( ) ) ?? [ ]
301302 var driver = try Driver ( args: [ " swiftc " ,
302- " -target " , " x86_64-apple-macosx11.0 " ,
303303 " -I " , cHeadersPath. nativePathString ( escaped: true ) ,
304304 " -I " , swiftModuleInterfacesPath. nativePathString ( escaped: true ) ,
305+ " -I " , stdlibPath. nativePathString ( escaped: true ) ,
306+ " -I " , shimsPath. nativePathString ( escaped: true ) ,
305307 " -explicit-module-build " ,
306308 " -import-objc-header " , bridgingHeaderpath. nativePathString ( escaped: true ) ,
307309 source0. nativePathString ( escaped: true ) ,
@@ -331,6 +333,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
331333 /// Test generation of explicit module build jobs for dependency modules when the driver
332334 /// is invoked with -explicit-module-build
333335 func testBridgingHeaderDeps( ) throws {
336+ let ( stdlibPath, shimsPath, _, _) = try getDriverArtifactsForScanning ( )
334337 try withTemporaryDirectory { path in
335338 let main = path. appending ( component: " testExplicitModuleBuildJobs.swift " )
336339 try localFileSystem. writeFileContents ( main, bytes:
@@ -350,9 +353,10 @@ final class ExplicitModuleBuildTests: XCTestCase {
350353 . appending ( component: " Swift " )
351354 let sdkArgumentsForTesting = ( try ? Driver . sdkArgumentsForTesting ( ) ) ?? [ ]
352355 var driver = try Driver ( args: [ " swiftc " ,
353- " -target " , " x86_64-apple-macosx11.0 " ,
354356 " -I " , cHeadersPath. nativePathString ( escaped: true ) ,
355357 " -I " , swiftModuleInterfacesPath. nativePathString ( escaped: true ) ,
358+ " -I " , stdlibPath. nativePathString ( escaped: true ) ,
359+ " -I " , shimsPath. nativePathString ( escaped: true ) ,
356360 " -explicit-module-build " ,
357361 " -import-objc-header " , bridgingHeaderpath. nativePathString ( escaped: true ) ,
358362 main. nativePathString ( escaped: true ) ] + sdkArgumentsForTesting)
@@ -492,6 +496,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
492496 /// Test generation of explicit module build jobs for dependency modules when the driver
493497 /// is invoked with -explicit-module-build
494498 func testExplicitModuleBuildJobs( ) throws {
499+ let ( stdlibPath, shimsPath, _, hostTriple) = try getDriverArtifactsForScanning ( )
495500 try withTemporaryDirectory { path in
496501 let main = path. appending ( component: " testExplicitModuleBuildJobs.swift " )
497502 try localFileSystem. writeFileContents ( main, bytes:
@@ -512,9 +517,10 @@ final class ExplicitModuleBuildTests: XCTestCase {
512517 . appending ( component: " Swift " )
513518 let sdkArgumentsForTesting = ( try ? Driver . sdkArgumentsForTesting ( ) ) ?? [ ]
514519 var driver = try Driver ( args: [ " swiftc " ,
515- " -target " , " x86_64-apple-macosx11.0 " ,
516520 " -I " , cHeadersPath. nativePathString ( escaped: true ) ,
517521 " -I " , swiftModuleInterfacesPath. nativePathString ( escaped: true ) ,
522+ " -I " , stdlibPath. nativePathString ( escaped: true ) ,
523+ " -I " , shimsPath. nativePathString ( escaped: true ) ,
518524 " -explicit-module-build " ,
519525 " -import-objc-header " , bridgingHeaderpath. nativePathString ( escaped: true ) ,
520526 main. nativePathString ( escaped: true ) ] + sdkArgumentsForTesting)
@@ -589,6 +595,12 @@ final class ExplicitModuleBuildTests: XCTestCase {
589595 try checkExplicitModuleBuildJob ( job: job, moduleId: . clang( " _SwiftConcurrencyShims " ) ,
590596 dependencyGraph: dependencyGraph)
591597 }
598+ else if hostTriple. isMacOSX,
599+ hostTriple. version ( for: . macOS) < Triple . Version ( 11 , 0 , 0 ) ,
600+ relativeOutputPathFileName. starts ( with: " X- " ) {
601+ try checkExplicitModuleBuildJob ( job: job, moduleId: . clang( " X " ) ,
602+ dependencyGraph: dependencyGraph)
603+ }
592604 else {
593605 XCTFail ( " Unexpected module dependency build job output: \( outputFilePath) " )
594606 }
@@ -616,6 +628,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
616628 /// Test generation of explicit module build jobs for dependency modules when the driver
617629 /// is invoked with -explicit-module-build, -verify-emitted-module-interface and -enable-library-evolution.
618630 func testExplicitModuleVerifyInterfaceJobs( ) throws {
631+ let ( stdlibPath, shimsPath, _, _) = try getDriverArtifactsForScanning ( )
619632 try withTemporaryDirectory { path in
620633 let main = path. appending ( component: " testExplicitModuleVerifyInterfaceJobs.swift " )
621634 try localFileSystem. writeFileContents ( main) {
@@ -632,9 +645,10 @@ final class ExplicitModuleBuildTests: XCTestCase {
632645 let privateSwiftInterfacePath : AbsolutePath = path. appending ( component: " testExplicitModuleVerifyInterfaceJobs.private.swiftinterface " )
633646 let sdkArgumentsForTesting = ( try ? Driver . sdkArgumentsForTesting ( ) ) ?? [ ]
634647 var driver = try Driver ( args: [ " swiftc " ,
635- " -target " , " x86_64-apple-macosx11.0 " ,
636648 " -I " , cHeadersPath. nativePathString ( escaped: true ) ,
637649 " -I " , swiftModuleInterfacesPath. nativePathString ( escaped: true ) ,
650+ " -I " , stdlibPath. nativePathString ( escaped: true ) ,
651+ " -I " , shimsPath. nativePathString ( escaped: true ) ,
638652 " -emit-module-interface-path " , swiftInterfacePath. nativePathString ( escaped: true ) ,
639653 " -emit-private-module-interface-path " , privateSwiftInterfacePath. nativePathString ( escaped: true ) ,
640654 " -explicit-module-build " , " -verify-emitted-module-interface " ,
@@ -748,6 +762,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
748762 /// Test generation of explicit module build jobs for dependency modules when the driver
749763 /// is invoked with -explicit-module-build and -pch-output-dir
750764 func testExplicitModuleBuildPCHOutputJobs( ) throws {
765+ let ( stdlibPath, shimsPath, _, _) = try getDriverArtifactsForScanning ( )
751766 try withTemporaryDirectory { path in
752767 let main = path. appending ( component: " testExplicitModuleBuildPCHOutputJobs.swift " )
753768 try localFileSystem. writeFileContents ( main, bytes:
@@ -769,9 +784,10 @@ final class ExplicitModuleBuildTests: XCTestCase {
769784 let sdkArgumentsForTesting = ( try ? Driver . sdkArgumentsForTesting ( ) ) ?? [ ]
770785 let pchOutputDir : AbsolutePath = path
771786 var driver = try Driver ( args: [ " swiftc " ,
772- " -target " , " x86_64-apple-macosx11.0 " ,
773787 " -I " , cHeadersPath. nativePathString ( escaped: true ) ,
774788 " -I " , swiftModuleInterfacesPath. nativePathString ( escaped: true ) ,
789+ " -I " , stdlibPath. nativePathString ( escaped: true ) ,
790+ " -I " , shimsPath. nativePathString ( escaped: true ) ,
775791 " -explicit-module-build " ,
776792 " -import-objc-header " , bridgingHeaderpath. nativePathString ( escaped: true ) ,
777793 " -pch-output-dir " , pchOutputDir. nativePathString ( escaped: true ) ,
@@ -883,6 +899,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
883899 }
884900
885901 func testImmediateModeExplicitModuleBuild( ) throws {
902+ let ( stdlibPath, shimsPath, _, _) = try getDriverArtifactsForScanning ( )
886903 try withTemporaryDirectory { path in
887904 let main = path. appending ( component: " testExplicitModuleBuildJobs.swift " )
888905 try localFileSystem. writeFileContents ( main, bytes: " import C \n " )
@@ -895,9 +912,10 @@ final class ExplicitModuleBuildTests: XCTestCase {
895912 . appending ( component: " Swift " )
896913 let sdkArgumentsForTesting = ( try ? Driver . sdkArgumentsForTesting ( ) ) ?? [ ]
897914 var driver = try Driver ( args: [ " swift " ,
898- " -target " , " x86_64-apple-macosx11.0 " ,
899915 " -I " , cHeadersPath. nativePathString ( escaped: true ) ,
900916 " -I " , swiftModuleInterfacesPath. nativePathString ( escaped: true ) ,
917+ " -I " , stdlibPath. nativePathString ( escaped: true ) ,
918+ " -I " , shimsPath. nativePathString ( escaped: true ) ,
901919 " -explicit-module-build " ,
902920 main. nativePathString ( escaped: true ) ] + sdkArgumentsForTesting)
903921
@@ -1723,12 +1741,12 @@ final class ExplicitModuleBuildTests: XCTestCase {
17231741 // #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 110000
17241742 let expectedNumberOfDependencies : Int
17251743 if hostTriple. isMacOSX,
1726- hostTriple. version ( for: . macOS) >= Triple . Version ( 11 , 0 , 0 ) {
1727- expectedNumberOfDependencies = 11
1744+ hostTriple. version ( for: . macOS) < Triple . Version ( 11 , 0 , 0 ) {
1745+ expectedNumberOfDependencies = 12
17281746 } else if driver. targetTriple. isWindows {
17291747 expectedNumberOfDependencies = 14
17301748 } else {
1731- expectedNumberOfDependencies = 12
1749+ expectedNumberOfDependencies = 11
17321750 }
17331751
17341752 // Dispatch several iterations in parallel
0 commit comments