Skip to content

Commit bafa1ba

Browse files
authored
Add additional test cases to the ModuleAliasing suite (#8155)
1 parent eba2944 commit bafa1ba

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

Fixtures/ModuleAliasing/NestedDeps1/AppPkg/Sources/App/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import X
33
import AFooUtils
44
import CarUtils
55
import XFooUtils
6-
import Utils
6+
import XUtils
77

88
funcInA()
99
funcInX()

Fixtures/ModuleAliasing/NestedDeps2/AppPkg/Sources/App/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010

1111
import A
12-
import Utils
12+
import XUtils
1313

1414
print("START")
1515

Tests/FunctionalTests/ModuleAliasingFixtureTests.swift

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,34 @@ final class ModuleAliasingFixtureTests: XCTestCase {
4141
_ = try await SwiftPM.Build.execute(packagePath: pkgPath)
4242
}
4343
}
44+
45+
func testModuleNestedDeps1() async throws {
46+
try await fixture(name: "ModuleAliasing/NestedDeps1") { fixturePath in
47+
let pkgPath = fixturePath.appending(components: "AppPkg")
48+
let buildPath = pkgPath.appending(components: ".build", try UserToolchain.default.targetTriple.platformBuildPathComponent, "debug")
49+
await XCTAssertBuilds(pkgPath, extraArgs: ["--vv"])
50+
XCTAssertFileExists(buildPath.appending(components: "App"))
51+
XCTAssertFileExists(buildPath.appending(components: "Modules", "A.swiftmodule"))
52+
XCTAssertFileExists(buildPath.appending(components: "Modules", "AFooUtils.swiftmodule"))
53+
XCTAssertFileExists(buildPath.appending(components: "Modules", "CarUtils.swiftmodule"))
54+
XCTAssertFileExists(buildPath.appending(components: "Modules", "X.swiftmodule"))
55+
XCTAssertFileExists(buildPath.appending(components: "Modules", "XFooUtils.swiftmodule"))
56+
XCTAssertFileExists(buildPath.appending(components: "Modules", "XUtils.swiftmodule"))
57+
_ = try await SwiftPM.Build.execute(packagePath: pkgPath)
58+
}
59+
}
60+
61+
func testModuleNestedDeps2() async throws {
62+
try await fixture(name: "ModuleAliasing/NestedDeps2") { fixturePath in
63+
let pkgPath = fixturePath.appending(components: "AppPkg")
64+
let buildPath = pkgPath.appending(components: ".build", try UserToolchain.default.targetTriple.platformBuildPathComponent, "debug")
65+
await XCTAssertBuilds(pkgPath, extraArgs: ["--vv"])
66+
XCTAssertFileExists(buildPath.appending(components: "App"))
67+
XCTAssertFileExists(buildPath.appending(components: "Modules", "A.swiftmodule"))
68+
XCTAssertFileExists(buildPath.appending(components: "Modules", "BUtils.swiftmodule"))
69+
XCTAssertFileExists(buildPath.appending(components: "Modules", "CUtils.swiftmodule"))
70+
XCTAssertFileExists(buildPath.appending(components: "Modules", "XUtils.swiftmodule"))
71+
_ = try await SwiftPM.Build.execute(packagePath: pkgPath)
72+
}
73+
}
4474
}

0 commit comments

Comments
 (0)