@@ -30,32 +30,39 @@ struct ModuleAliasingFixtureTests {
3030 . tags(
3131 Tag . Feature. Command. Build,
3232 ) ,
33- arguments: SupportedBuildSystemOnAllPlatforms , BuildConfiguration . allCases ,
33+ arguments: getBuildData ( for : SupportedBuildSystemOnAllPlatforms ) ,
3434 )
3535 func moduleDirectDeps1(
36- buildSystem: BuildSystemProvider . Kind ,
37- configuration: BuildConfiguration ,
36+ data: BuildData ,
3837 ) async throws {
38+ let buildSystem = data. buildSystem
39+ let configuration = data. config
40+
3941 try await withKnownIssue ( isIntermittent: true ) {
4042 try await fixture ( name: " ModuleAliasing/DirectDeps1 " ) { fixturePath in
4143 let pkgPath = fixturePath. appending ( components: " AppPkg " )
4244 let buildPath = try pkgPath. appending ( components: buildSystem. binPath ( for: configuration) )
45+ let expectedModules = [
46+ " GameUtils.swiftmodule " ,
47+ " Utils.swiftmodule " ,
48+ ]
4349 try await executeSwiftBuild (
4450 pkgPath,
4551 configuration: configuration,
4652 extraArgs: [ " --vv " ] ,
4753 buildSystem: buildSystem,
4854 )
55+
4956 expectFileExists ( at: buildPath. appending ( components: executableName ( " App " ) ) )
50- switch buildSystem {
57+ for file in expectedModules {
58+ switch buildSystem {
5159 case . native:
52- expectFileExists ( at: buildPath. appending ( components: " Modules " , " GameUtils.swiftmodule " ) )
53- expectFileExists ( at: buildPath. appending ( components: " Modules " , " Utils.swiftmodule " ) )
60+ expectFileExists ( at: buildPath. appending ( components: " Modules " , file) )
5461 case . swiftbuild:
55- expectFileExists ( at: buildPath. appending ( components: " GameUtils.swiftmodule " ) )
56- expectFileExists ( at: buildPath. appending ( components: " Utils.swiftmodule " ) )
62+ expectFileExists ( at: buildPath. appending ( components: file) )
5763 case . xcode:
58- #expect( Bool ( false ) , " expectations are not implemented " )
64+ Issue . record ( " expectations are not implemented " )
65+ }
5966 }
6067 _ = try await executeSwiftBuild (
6168 pkgPath,
@@ -67,93 +74,112 @@ struct ModuleAliasingFixtureTests {
6774 ProcessInfo . hostOperatingSystem == . windows && buildSystem == . swiftbuild
6875 }
6976 }
70-
77+
7178 @Test (
7279 . issue( " https://github.com/swiftlang/swift-package-manager/issues/8987 " , relationship: . defect) ,
7380 . tags(
7481 Tag . Feature. Command. Build,
7582 ) ,
76- arguments: SupportedBuildSystemOnAllPlatforms , BuildConfiguration . allCases ,
83+ arguments: getBuildData ( for : SupportedBuildSystemOnAllPlatforms ) ,
7784 )
7885 func moduleDirectDeps2(
79- buildSystem: BuildSystemProvider . Kind ,
80- configuration: BuildConfiguration ,
86+ data: BuildData
8187 ) async throws {
82- try await withKnownIssue {
88+ let buildSystem = data. buildSystem
89+ let configuration = data. config
8390 try await fixture ( name: " ModuleAliasing/DirectDeps2 " ) { fixturePath in
8491 let pkgPath = fixturePath. appending ( components: " AppPkg " )
8592 let buildPath = try pkgPath. appending ( components: buildSystem. binPath ( for: configuration) )
93+ let expectedModules = [
94+ " AUtils.swiftmodule " ,
95+ " BUtils.swiftmodule " ,
96+ ]
8697 try await executeSwiftBuild (
8798 pkgPath,
8899 configuration: configuration,
89100 extraArgs: [ " --vv " ] ,
90101 buildSystem: buildSystem,
91102 )
92103 expectFileExists ( at: buildPath. appending ( components: executableName ( " App " ) ) )
93- expectFileExists ( at: buildPath. appending ( components: " Modules " , " AUtils.swiftmodule " ) )
94- expectFileExists ( at: buildPath. appending ( components: " Modules " , " BUtils.swiftmodule " ) )
104+ for file in expectedModules {
105+ switch buildSystem {
106+ case . native:
107+ expectFileExists ( at: buildPath. appending ( components: " Modules " , file) )
108+ case . swiftbuild:
109+ expectFileExists ( at: buildPath. appending ( components: file) )
110+ case . xcode:
111+ Issue . record ( " expectations are not implemented " )
112+ }
113+ }
95114 _ = try await executeSwiftBuild (
96115 pkgPath,
97116 configuration: configuration,
98117 buildSystem: buildSystem,
99118 )
100119 }
101- } when: {
102- buildSystem == . swiftbuild
103- }
104120 }
105-
121+
106122 @Test (
107123 . issue( " https://github.com/swiftlang/swift-package-manager/issues/8987 " , relationship: . defect) ,
108124 . tags(
109125 Tag . Feature. Command. Build,
110126 ) ,
111- arguments: SupportedBuildSystemOnAllPlatforms , BuildConfiguration . allCases ,
127+ arguments: getBuildData ( for : SupportedBuildSystemOnAllPlatforms ) ,
112128 )
113129 func moduleNestedDeps1(
114- buildSystem: BuildSystemProvider . Kind ,
115- configuration: BuildConfiguration ,
130+ data: BuildData ,
116131 ) async throws {
117- try await withKnownIssue {
132+ let buildSystem = data. buildSystem
133+ let configuration = data. config
118134 try await fixture ( name: " ModuleAliasing/NestedDeps1 " ) { fixturePath in
119135 let pkgPath = fixturePath. appending ( components: " AppPkg " )
120136 let buildPath = try pkgPath. appending ( components: buildSystem. binPath ( for: configuration) )
137+ let expectedModules = [
138+ " A.swiftmodule " ,
139+ " AFooUtils.swiftmodule " ,
140+ " CarUtils.swiftmodule " ,
141+ " X.swiftmodule " ,
142+ " XFooUtils.swiftmodule " ,
143+ " XUtils.swiftmodule " ,
144+ ]
121145 try await executeSwiftBuild (
122146 pkgPath,
123147 configuration: configuration,
124148 extraArgs: [ " --vv " ] ,
125149 buildSystem: buildSystem,
126150 )
127151 expectFileExists ( at: buildPath. appending ( components: executableName ( " App " ) ) )
128- expectFileExists ( at: buildPath. appending ( components: " Modules " , " A.swiftmodule " ) )
129- expectFileExists ( at: buildPath. appending ( components: " Modules " , " AFooUtils.swiftmodule " ) )
130- expectFileExists ( at: buildPath. appending ( components: " Modules " , " CarUtils.swiftmodule " ) )
131- expectFileExists ( at: buildPath. appending ( components: " Modules " , " X.swiftmodule " ) )
132- expectFileExists ( at: buildPath. appending ( components: " Modules " , " XFooUtils.swiftmodule " ) )
133- expectFileExists ( at: buildPath. appending ( components: " Modules " , " XUtils.swiftmodule " ) )
152+ for file in expectedModules {
153+ switch buildSystem {
154+ case . native:
155+ expectFileExists ( at: buildPath. appending ( components: " Modules " , file) )
156+ case . swiftbuild:
157+ expectFileExists ( at: buildPath. appending ( components: file) )
158+ case . xcode:
159+ Issue . record ( " expectations are not implemented " )
160+ }
161+ }
162+
134163 _ = try await executeSwiftBuild (
135164 pkgPath,
136165 configuration: configuration,
137166 buildSystem: buildSystem,
138167 )
139168 }
140- } when: {
141- buildSystem == . swiftbuild
142- }
143169 }
144-
170+
145171 @Test (
146172 . issue( " https://github.com/swiftlang/swift-package-manager/issues/8987 " , relationship: . defect) ,
147173 . tags(
148174 Tag . Feature. Command. Build,
149175 ) ,
150- arguments: SupportedBuildSystemOnAllPlatforms , BuildConfiguration . allCases ,
176+ arguments: getBuildData ( for : SupportedBuildSystemOnAllPlatforms ) ,
151177 )
152178 func moduleNestedDeps2(
153- buildSystem: BuildSystemProvider . Kind ,
154- configuration: BuildConfiguration ,
179+ data: BuildData ,
155180 ) async throws {
156- try await withKnownIssue {
181+ let buildSystem = data. buildSystem
182+ let configuration = data. config
157183 try await fixture ( name: " ModuleAliasing/NestedDeps2 " ) { fixturePath in
158184 let pkgPath = fixturePath. appending ( components: " AppPkg " )
159185 let buildPath = try pkgPath. appending ( components: buildSystem. binPath ( for: configuration) )
@@ -163,19 +189,28 @@ struct ModuleAliasingFixtureTests {
163189 extraArgs: [ " --vv " ] ,
164190 buildSystem: buildSystem,
165191 )
192+ let expectedModules = [
193+ " A.swiftmodule " ,
194+ " BUtils.swiftmodule " ,
195+ " CUtils.swiftmodule " ,
196+ " XUtils.swiftmodule " ,
197+ ]
166198 expectFileExists ( at: buildPath. appending ( components: executableName ( " App " ) ) )
167- expectFileExists ( at: buildPath. appending ( components: " Modules " , " A.swiftmodule " ) )
168- expectFileExists ( at: buildPath. appending ( components: " Modules " , " BUtils.swiftmodule " ) )
169- expectFileExists ( at: buildPath. appending ( components: " Modules " , " CUtils.swiftmodule " ) )
170- expectFileExists ( at: buildPath. appending ( components: " Modules " , " XUtils.swiftmodule " ) )
199+ for file in expectedModules {
200+ switch buildSystem {
201+ case . native:
202+ expectFileExists ( at: buildPath. appending ( components: " Modules " , file) )
203+ case . swiftbuild:
204+ expectFileExists ( at: buildPath. appending ( components: file) )
205+ case . xcode:
206+ Issue . record ( " expectations are not implemented " )
207+ }
208+ }
171209 _ = try await executeSwiftBuild (
172210 pkgPath,
173211 configuration: configuration,
174212 buildSystem: buildSystem,
175213 )
176214 }
177- } when: {
178- buildSystem == . swiftbuild
179- }
180215 }
181216}
0 commit comments