@@ -519,10 +519,15 @@ final class ExplicitModuleBuildTests: XCTestCase {
519
519
. parentDirectory // toolchain root
520
520
let stdLibPath = toolchainRootPath. appending ( component: " lib " )
521
521
. appending ( component: " swift " )
522
- . appending ( component: " macosx " )
522
+ . appending ( component: driver . targetTriple . osNameUnversioned )
523
523
let shimsPath = toolchainRootPath. appending ( component: " lib " )
524
524
. appending ( component: " swift " )
525
525
. appending ( component: " shims " )
526
+ XCTAssertTrue ( localFileSystem. exists ( stdLibPath) ,
527
+ " expected Swift StdLib at: \( stdLibPath. description) " )
528
+ XCTAssertTrue ( localFileSystem. exists ( shimsPath) ,
529
+ " expected Swift Shims at: \( shimsPath. description) " )
530
+
526
531
// The dependency oracle wraps an instance of libSwiftScan and ensures thread safety across
527
532
// queries.
528
533
let dependencyOracle = InterModuleDependencyOracle ( )
@@ -551,6 +556,9 @@ final class ExplicitModuleBuildTests: XCTestCase {
551
556
" -I " , shimsPath. description,
552
557
main. pathString]
553
558
559
+ // Here purely to dump diagnostic output in a reasonable fashion when things go wrong.
560
+ let lock = NSLock ( )
561
+
554
562
// Dispatch several iterations in parallel
555
563
DispatchQueue . concurrentPerform ( iterations: 20 ) { index in
556
564
// Give the main modules different names
@@ -559,6 +567,14 @@ final class ExplicitModuleBuildTests: XCTestCase {
559
567
let dependencyGraph =
560
568
try ! dependencyOracle. getDependencies ( workingDirectory: path,
561
569
commandLine: iterationCommand)
570
+ if ( dependencyGraph. modules. count != 11 ) {
571
+ lock. lock ( )
572
+ print ( " Unexpected Dependency Scanning Result ( \( dependencyGraph. modules. count) modules): " )
573
+ dependencyGraph. modules. forEach {
574
+ print ( $0. key. moduleName)
575
+ }
576
+ lock. unlock ( )
577
+ }
562
578
XCTAssertTrue ( dependencyGraph. modules. count == 11 )
563
579
}
564
580
}
0 commit comments