@@ -559,6 +559,16 @@ final class ExplicitModuleBuildTests: XCTestCase {
559
559
// Here purely to dump diagnostic output in a reasonable fashion when things go wrong.
560
560
let lock = NSLock ( )
561
561
562
+ // Module `X` is only imported when:
563
+ // #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 110000
564
+ let expectedNumberOfDependencies : Int
565
+ if driver. targetTriple. isMacOSX,
566
+ driver. targetTriple. version ( for: . macOS) < Triple . Version ( 11 , 0 , 0 ) {
567
+ expectedNumberOfDependencies = 12
568
+ } else {
569
+ expectedNumberOfDependencies = 11
570
+ }
571
+
562
572
// Dispatch several iterations in parallel
563
573
DispatchQueue . concurrentPerform ( iterations: 20 ) { index in
564
574
// Give the main modules different names
@@ -567,15 +577,15 @@ final class ExplicitModuleBuildTests: XCTestCase {
567
577
let dependencyGraph =
568
578
try ! dependencyOracle. getDependencies ( workingDirectory: path,
569
579
commandLine: iterationCommand)
570
- if ( dependencyGraph. modules. count != 11 ) {
580
+ if ( dependencyGraph. modules. count != expectedNumberOfDependencies ) {
571
581
lock. lock ( )
572
582
print ( " Unexpected Dependency Scanning Result ( \( dependencyGraph. modules. count) modules): " )
573
583
dependencyGraph. modules. forEach {
574
584
print ( $0. key. moduleName)
575
585
}
576
586
lock. unlock ( )
577
587
}
578
- XCTAssertTrue ( dependencyGraph. modules. count == 11 )
588
+ XCTAssertTrue ( dependencyGraph. modules. count == expectedNumberOfDependencies )
579
589
}
580
590
}
581
591
}
0 commit comments