@@ -275,6 +275,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
275
275
}
276
276
277
277
func testModuleDependencyBuildCommandUniqueDepFile( ) throws {
278
+ let ( stdlibPath, shimsPath, _, _) = try getDriverArtifactsForScanning ( )
278
279
try withTemporaryDirectory { path in
279
280
let source0 = path. appending ( component: " testModuleDependencyBuildCommandUniqueDepFile1.swift " )
280
281
let source1 = path. appending ( component: " testModuleDependencyBuildCommandUniqueDepFile2.swift " )
@@ -299,9 +300,10 @@ final class ExplicitModuleBuildTests: XCTestCase {
299
300
. appending ( component: " Swift " )
300
301
let sdkArgumentsForTesting = ( try ? Driver . sdkArgumentsForTesting ( ) ) ?? [ ]
301
302
var driver = try Driver ( args: [ " swiftc " ,
302
- " -target " , " x86_64-apple-macosx11.0 " ,
303
303
" -I " , cHeadersPath. nativePathString ( escaped: true ) ,
304
304
" -I " , swiftModuleInterfacesPath. nativePathString ( escaped: true ) ,
305
+ " -I " , stdlibPath. nativePathString ( escaped: true ) ,
306
+ " -I " , shimsPath. nativePathString ( escaped: true ) ,
305
307
" -explicit-module-build " ,
306
308
" -import-objc-header " , bridgingHeaderpath. nativePathString ( escaped: true ) ,
307
309
source0. nativePathString ( escaped: true ) ,
@@ -331,6 +333,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
331
333
/// Test generation of explicit module build jobs for dependency modules when the driver
332
334
/// is invoked with -explicit-module-build
333
335
func testBridgingHeaderDeps( ) throws {
336
+ let ( stdlibPath, shimsPath, _, _) = try getDriverArtifactsForScanning ( )
334
337
try withTemporaryDirectory { path in
335
338
let main = path. appending ( component: " testExplicitModuleBuildJobs.swift " )
336
339
try localFileSystem. writeFileContents ( main, bytes:
@@ -350,9 +353,10 @@ final class ExplicitModuleBuildTests: XCTestCase {
350
353
. appending ( component: " Swift " )
351
354
let sdkArgumentsForTesting = ( try ? Driver . sdkArgumentsForTesting ( ) ) ?? [ ]
352
355
var driver = try Driver ( args: [ " swiftc " ,
353
- " -target " , " x86_64-apple-macosx11.0 " ,
354
356
" -I " , cHeadersPath. nativePathString ( escaped: true ) ,
355
357
" -I " , swiftModuleInterfacesPath. nativePathString ( escaped: true ) ,
358
+ " -I " , stdlibPath. nativePathString ( escaped: true ) ,
359
+ " -I " , shimsPath. nativePathString ( escaped: true ) ,
356
360
" -explicit-module-build " ,
357
361
" -import-objc-header " , bridgingHeaderpath. nativePathString ( escaped: true ) ,
358
362
main. nativePathString ( escaped: true ) ] + sdkArgumentsForTesting)
@@ -492,6 +496,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
492
496
/// Test generation of explicit module build jobs for dependency modules when the driver
493
497
/// is invoked with -explicit-module-build
494
498
func testExplicitModuleBuildJobs( ) throws {
499
+ let ( stdlibPath, shimsPath, _, hostTriple) = try getDriverArtifactsForScanning ( )
495
500
try withTemporaryDirectory { path in
496
501
let main = path. appending ( component: " testExplicitModuleBuildJobs.swift " )
497
502
try localFileSystem. writeFileContents ( main, bytes:
@@ -512,9 +517,10 @@ final class ExplicitModuleBuildTests: XCTestCase {
512
517
. appending ( component: " Swift " )
513
518
let sdkArgumentsForTesting = ( try ? Driver . sdkArgumentsForTesting ( ) ) ?? [ ]
514
519
var driver = try Driver ( args: [ " swiftc " ,
515
- " -target " , " x86_64-apple-macosx11.0 " ,
516
520
" -I " , cHeadersPath. nativePathString ( escaped: true ) ,
517
521
" -I " , swiftModuleInterfacesPath. nativePathString ( escaped: true ) ,
522
+ " -I " , stdlibPath. nativePathString ( escaped: true ) ,
523
+ " -I " , shimsPath. nativePathString ( escaped: true ) ,
518
524
" -explicit-module-build " ,
519
525
" -import-objc-header " , bridgingHeaderpath. nativePathString ( escaped: true ) ,
520
526
main. nativePathString ( escaped: true ) ] + sdkArgumentsForTesting)
@@ -589,6 +595,12 @@ final class ExplicitModuleBuildTests: XCTestCase {
589
595
try checkExplicitModuleBuildJob ( job: job, moduleId: . clang( " _SwiftConcurrencyShims " ) ,
590
596
dependencyGraph: dependencyGraph)
591
597
}
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
+ }
592
604
else {
593
605
XCTFail ( " Unexpected module dependency build job output: \( outputFilePath) " )
594
606
}
@@ -616,6 +628,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
616
628
/// Test generation of explicit module build jobs for dependency modules when the driver
617
629
/// is invoked with -explicit-module-build, -verify-emitted-module-interface and -enable-library-evolution.
618
630
func testExplicitModuleVerifyInterfaceJobs( ) throws {
631
+ let ( stdlibPath, shimsPath, _, _) = try getDriverArtifactsForScanning ( )
619
632
try withTemporaryDirectory { path in
620
633
let main = path. appending ( component: " testExplicitModuleVerifyInterfaceJobs.swift " )
621
634
try localFileSystem. writeFileContents ( main) {
@@ -632,9 +645,10 @@ final class ExplicitModuleBuildTests: XCTestCase {
632
645
let privateSwiftInterfacePath : AbsolutePath = path. appending ( component: " testExplicitModuleVerifyInterfaceJobs.private.swiftinterface " )
633
646
let sdkArgumentsForTesting = ( try ? Driver . sdkArgumentsForTesting ( ) ) ?? [ ]
634
647
var driver = try Driver ( args: [ " swiftc " ,
635
- " -target " , " x86_64-apple-macosx11.0 " ,
636
648
" -I " , cHeadersPath. nativePathString ( escaped: true ) ,
637
649
" -I " , swiftModuleInterfacesPath. nativePathString ( escaped: true ) ,
650
+ " -I " , stdlibPath. nativePathString ( escaped: true ) ,
651
+ " -I " , shimsPath. nativePathString ( escaped: true ) ,
638
652
" -emit-module-interface-path " , swiftInterfacePath. nativePathString ( escaped: true ) ,
639
653
" -emit-private-module-interface-path " , privateSwiftInterfacePath. nativePathString ( escaped: true ) ,
640
654
" -explicit-module-build " , " -verify-emitted-module-interface " ,
@@ -748,6 +762,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
748
762
/// Test generation of explicit module build jobs for dependency modules when the driver
749
763
/// is invoked with -explicit-module-build and -pch-output-dir
750
764
func testExplicitModuleBuildPCHOutputJobs( ) throws {
765
+ let ( stdlibPath, shimsPath, _, _) = try getDriverArtifactsForScanning ( )
751
766
try withTemporaryDirectory { path in
752
767
let main = path. appending ( component: " testExplicitModuleBuildPCHOutputJobs.swift " )
753
768
try localFileSystem. writeFileContents ( main, bytes:
@@ -769,9 +784,10 @@ final class ExplicitModuleBuildTests: XCTestCase {
769
784
let sdkArgumentsForTesting = ( try ? Driver . sdkArgumentsForTesting ( ) ) ?? [ ]
770
785
let pchOutputDir : AbsolutePath = path
771
786
var driver = try Driver ( args: [ " swiftc " ,
772
- " -target " , " x86_64-apple-macosx11.0 " ,
773
787
" -I " , cHeadersPath. nativePathString ( escaped: true ) ,
774
788
" -I " , swiftModuleInterfacesPath. nativePathString ( escaped: true ) ,
789
+ " -I " , stdlibPath. nativePathString ( escaped: true ) ,
790
+ " -I " , shimsPath. nativePathString ( escaped: true ) ,
775
791
" -explicit-module-build " ,
776
792
" -import-objc-header " , bridgingHeaderpath. nativePathString ( escaped: true ) ,
777
793
" -pch-output-dir " , pchOutputDir. nativePathString ( escaped: true ) ,
@@ -883,6 +899,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
883
899
}
884
900
885
901
func testImmediateModeExplicitModuleBuild( ) throws {
902
+ let ( stdlibPath, shimsPath, _, _) = try getDriverArtifactsForScanning ( )
886
903
try withTemporaryDirectory { path in
887
904
let main = path. appending ( component: " testExplicitModuleBuildJobs.swift " )
888
905
try localFileSystem. writeFileContents ( main, bytes: " import C \n " )
@@ -895,9 +912,10 @@ final class ExplicitModuleBuildTests: XCTestCase {
895
912
. appending ( component: " Swift " )
896
913
let sdkArgumentsForTesting = ( try ? Driver . sdkArgumentsForTesting ( ) ) ?? [ ]
897
914
var driver = try Driver ( args: [ " swift " ,
898
- " -target " , " x86_64-apple-macosx11.0 " ,
899
915
" -I " , cHeadersPath. nativePathString ( escaped: true ) ,
900
916
" -I " , swiftModuleInterfacesPath. nativePathString ( escaped: true ) ,
917
+ " -I " , stdlibPath. nativePathString ( escaped: true ) ,
918
+ " -I " , shimsPath. nativePathString ( escaped: true ) ,
901
919
" -explicit-module-build " ,
902
920
main. nativePathString ( escaped: true ) ] + sdkArgumentsForTesting)
903
921
@@ -1723,12 +1741,12 @@ final class ExplicitModuleBuildTests: XCTestCase {
1723
1741
// #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 110000
1724
1742
let expectedNumberOfDependencies : Int
1725
1743
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
1728
1746
} else if driver. targetTriple. isWindows {
1729
1747
expectedNumberOfDependencies = 14
1730
1748
} else {
1731
- expectedNumberOfDependencies = 12
1749
+ expectedNumberOfDependencies = 11
1732
1750
}
1733
1751
1734
1752
// Dispatch several iterations in parallel
0 commit comments