Skip to content

Commit 51a6c26

Browse files
authored
Merge pull request #1256 from artemcm/NewImplicitDependency-ConcurrencyShims
Adjust tests to Swift compiler's new implicit dependency import
2 parents 3e33739 + 2a99b03 commit 51a6c26

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

Tests/SwiftDriverTests/ExplicitModuleBuildTests.swift

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,10 @@ final class ExplicitModuleBuildTests: XCTestCase {
339339
try checkExplicitModuleBuildJob(job: job, moduleId: .clang("SwiftShims"),
340340
dependencyGraph: dependencyGraph)
341341
}
342+
else if relativeOutputPathFileName.starts(with: "_SwiftConcurrencyShims-") {
343+
try checkExplicitModuleBuildJob(job: job, moduleId: .clang("_SwiftConcurrencyShims"),
344+
dependencyGraph: dependencyGraph)
345+
}
342346
else {
343347
XCTFail("Unexpected module dependency build job output: \(outputFilePath)")
344348
}
@@ -441,6 +445,10 @@ final class ExplicitModuleBuildTests: XCTestCase {
441445
try checkExplicitModuleBuildJob(job: job, moduleId: .clang("SwiftShims"),
442446
dependencyGraph: dependencyGraph)
443447
}
448+
else if relativeOutputPathFileName.starts(with: "_SwiftConcurrencyShims-") {
449+
try checkExplicitModuleBuildJob(job: job, moduleId: .clang("_SwiftConcurrencyShims"),
450+
dependencyGraph: dependencyGraph)
451+
}
444452
else {
445453
XCTFail("Unexpected module dependency build job output: \(outputFilePath)")
446454
}
@@ -977,10 +985,13 @@ final class ExplicitModuleBuildTests: XCTestCase {
977985
let expectedImports2 = ["C", "E", "G", "Swift", "SwiftOnoneSupport", "_Concurrency"]
978986
// Dependnig on how recent the platform we are running on, the _StringProcessing module may or may not be present.
979987
let expectedImports3 = ["C", "E", "G", "Swift", "SwiftOnoneSupport", "_Concurrency", "_StringProcessing"]
988+
// Dependnig on how recent the platform we are running on, the _SwiftConcurrencyShims module may or may not be present.
989+
let expectedImports4 = ["C", "E", "G", "Swift", "SwiftOnoneSupport", "_Concurrency", "_StringProcessing", "_SwiftConcurrencyShims"]
980990
XCTAssertTrue(
981991
Set(imports.imports) == Set(expectedImports) ||
982992
Set(imports.imports) == Set(expectedImports2) ||
983-
Set(imports.imports) == Set(expectedImports3))
993+
Set(imports.imports) == Set(expectedImports3) ||
994+
Set(imports.imports) == Set(expectedImports4))
984995
}
985996
}
986997

@@ -1168,11 +1179,16 @@ final class ExplicitModuleBuildTests: XCTestCase {
11681179
let hasConcurrencyModule = dependencyGraph.modules.keys.contains {
11691180
$0.moduleName == "_Concurrency"
11701181
}
1182+
let hasConcurrencyShimsModule = dependencyGraph.modules.keys.contains {
1183+
$0.moduleName == "_SwiftConcurrencyShims"
1184+
}
11711185
let hasStringProcessingModule = dependencyGraph.modules.keys.contains {
11721186
$0.moduleName == "_StringProcessing"
11731187
}
11741188
let adjustedExpectedNumberOfDependencies =
1175-
expectedNumberOfDependencies + (hasConcurrencyModule ? 1 : 0) +
1189+
expectedNumberOfDependencies +
1190+
(hasConcurrencyModule ? 1 : 0) +
1191+
(hasConcurrencyShimsModule ? 1 : 0) +
11761192
(hasStringProcessingModule ? 1 : 0)
11771193

11781194
if (dependencyGraph.modules.count != adjustedExpectedNumberOfDependencies) {

0 commit comments

Comments
 (0)