@@ -30,32 +30,39 @@ struct ModuleAliasingFixtureTests {
30
30
. tags(
31
31
Tag . Feature. Command. Build,
32
32
) ,
33
- arguments: SupportedBuildSystemOnAllPlatforms , BuildConfiguration . allCases ,
33
+ arguments: getBuildData ( for : SupportedBuildSystemOnAllPlatforms ) ,
34
34
)
35
35
func moduleDirectDeps1(
36
- buildSystem: BuildSystemProvider . Kind ,
37
- configuration: BuildConfiguration ,
36
+ data: BuildData ,
38
37
) async throws {
38
+ let buildSystem = data. buildSystem
39
+ let configuration = data. config
40
+
39
41
try await withKnownIssue ( isIntermittent: true ) {
40
42
try await fixture ( name: " ModuleAliasing/DirectDeps1 " ) { fixturePath in
41
43
let pkgPath = fixturePath. appending ( components: " AppPkg " )
42
44
let buildPath = try pkgPath. appending ( components: buildSystem. binPath ( for: configuration) )
45
+ let expectedModules = [
46
+ " GameUtils.swiftmodule " ,
47
+ " Utils.swiftmodule " ,
48
+ ]
43
49
try await executeSwiftBuild (
44
50
pkgPath,
45
51
configuration: configuration,
46
52
extraArgs: [ " --vv " ] ,
47
53
buildSystem: buildSystem,
48
54
)
55
+
49
56
expectFileExists ( at: buildPath. appending ( components: executableName ( " App " ) ) )
50
- switch buildSystem {
57
+ for file in expectedModules {
58
+ switch buildSystem {
51
59
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) )
54
61
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) )
57
63
case . xcode:
58
- #expect( Bool ( false ) , " expectations are not implemented " )
64
+ Issue . record ( " expectations are not implemented " )
65
+ }
59
66
}
60
67
_ = try await executeSwiftBuild (
61
68
pkgPath,
@@ -67,93 +74,130 @@ struct ModuleAliasingFixtureTests {
67
74
ProcessInfo . hostOperatingSystem == . windows && buildSystem == . swiftbuild
68
75
}
69
76
}
70
-
77
+
71
78
@Test (
72
79
. issue( " https://github.com/swiftlang/swift-package-manager/issues/8987 " , relationship: . defect) ,
80
+ . issue( " https://github.com/swiftlang/swift-package-manager/pull/9130 " , relationship: . fixedBy) ,
81
+ . IssueWindowsLongPath,
82
+ . IssueWindowsCannotSaveAttachment,
73
83
. tags(
74
84
Tag . Feature. Command. Build,
75
85
) ,
76
- arguments: SupportedBuildSystemOnAllPlatforms , BuildConfiguration . allCases ,
86
+ arguments: getBuildData ( for : SupportedBuildSystemOnAllPlatforms ) ,
77
87
)
78
88
func moduleDirectDeps2(
79
- buildSystem: BuildSystemProvider . Kind ,
80
- configuration: BuildConfiguration ,
89
+ data: BuildData
81
90
) async throws {
82
- try await withKnownIssue {
91
+ let buildSystem = data. buildSystem
92
+ let configuration = data. config
93
+ try await withKnownIssue ( isIntermittent: true ) {
83
94
try await fixture ( name: " ModuleAliasing/DirectDeps2 " ) { fixturePath in
84
95
let pkgPath = fixturePath. appending ( components: " AppPkg " )
85
96
let buildPath = try pkgPath. appending ( components: buildSystem. binPath ( for: configuration) )
97
+ let expectedModules = [
98
+ " AUtils.swiftmodule " ,
99
+ " BUtils.swiftmodule " ,
100
+ ]
86
101
try await executeSwiftBuild (
87
102
pkgPath,
88
103
configuration: configuration,
89
104
extraArgs: [ " --vv " ] ,
90
105
buildSystem: buildSystem,
91
106
)
92
107
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 " ) )
108
+ for file in expectedModules {
109
+ switch buildSystem {
110
+ case . native:
111
+ expectFileExists ( at: buildPath. appending ( components: " Modules " , file) )
112
+ case . swiftbuild:
113
+ expectFileExists ( at: buildPath. appending ( components: file) )
114
+ case . xcode:
115
+ Issue . record ( " expectations are not implemented " )
116
+ }
117
+ }
95
118
_ = try await executeSwiftBuild (
96
119
pkgPath,
97
120
configuration: configuration,
98
121
buildSystem: buildSystem,
99
122
)
100
123
}
101
124
} when: {
102
- buildSystem == . swiftbuild
125
+ ProcessInfo . hostOperatingSystem == . windows && buildSystem == . swiftbuild
103
126
}
104
127
}
105
-
128
+
106
129
@Test (
107
130
. issue( " https://github.com/swiftlang/swift-package-manager/issues/8987 " , relationship: . defect) ,
131
+ . issue( " https://github.com/swiftlang/swift-package-manager/pull/9130 " , relationship: . fixedBy) ,
132
+ . IssueWindowsLongPath,
133
+ . IssueWindowsCannotSaveAttachment,
108
134
. tags(
109
135
Tag . Feature. Command. Build,
110
136
) ,
111
- arguments: SupportedBuildSystemOnAllPlatforms , BuildConfiguration . allCases ,
137
+ arguments: getBuildData ( for : SupportedBuildSystemOnAllPlatforms ) ,
112
138
)
113
139
func moduleNestedDeps1(
114
- buildSystem: BuildSystemProvider . Kind ,
115
- configuration: BuildConfiguration ,
140
+ data: BuildData ,
116
141
) async throws {
117
- try await withKnownIssue {
142
+ let buildSystem = data. buildSystem
143
+ let configuration = data. config
144
+ try await withKnownIssue ( isIntermittent: true ) {
118
145
try await fixture ( name: " ModuleAliasing/NestedDeps1 " ) { fixturePath in
119
146
let pkgPath = fixturePath. appending ( components: " AppPkg " )
120
147
let buildPath = try pkgPath. appending ( components: buildSystem. binPath ( for: configuration) )
148
+ let expectedModules = [
149
+ " A.swiftmodule " ,
150
+ " AFooUtils.swiftmodule " ,
151
+ " CarUtils.swiftmodule " ,
152
+ " X.swiftmodule " ,
153
+ " XFooUtils.swiftmodule " ,
154
+ " XUtils.swiftmodule " ,
155
+ ]
121
156
try await executeSwiftBuild (
122
157
pkgPath,
123
158
configuration: configuration,
124
159
extraArgs: [ " --vv " ] ,
125
160
buildSystem: buildSystem,
126
161
)
127
162
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 " ) )
163
+ for file in expectedModules {
164
+ switch buildSystem {
165
+ case . native:
166
+ expectFileExists ( at: buildPath. appending ( components: " Modules " , file) )
167
+ case . swiftbuild:
168
+ expectFileExists ( at: buildPath. appending ( components: file) )
169
+ case . xcode:
170
+ Issue . record ( " expectations are not implemented " )
171
+ }
172
+ }
173
+
134
174
_ = try await executeSwiftBuild (
135
175
pkgPath,
136
176
configuration: configuration,
137
177
buildSystem: buildSystem,
138
178
)
139
179
}
140
180
} when: {
141
- buildSystem == . swiftbuild
181
+ ProcessInfo . hostOperatingSystem == . windows && buildSystem == . swiftbuild
142
182
}
143
183
}
144
-
184
+
145
185
@Test (
146
186
. issue( " https://github.com/swiftlang/swift-package-manager/issues/8987 " , relationship: . defect) ,
187
+ . issue( " https://github.com/swiftlang/swift-package-manager/pull/9130 " , relationship: . fixedBy) ,
188
+ . IssueWindowsLongPath,
189
+ . IssueWindowsCannotSaveAttachment,
147
190
. tags(
148
191
Tag . Feature. Command. Build,
149
192
) ,
150
- arguments: SupportedBuildSystemOnAllPlatforms , BuildConfiguration . allCases ,
193
+ arguments: getBuildData ( for : SupportedBuildSystemOnAllPlatforms ) ,
151
194
)
152
195
func moduleNestedDeps2(
153
- buildSystem: BuildSystemProvider . Kind ,
154
- configuration: BuildConfiguration ,
196
+ data: BuildData ,
155
197
) async throws {
156
- try await withKnownIssue {
198
+ let buildSystem = data. buildSystem
199
+ let configuration = data. config
200
+ try await withKnownIssue ( isIntermittent: true ) {
157
201
try await fixture ( name: " ModuleAliasing/NestedDeps2 " ) { fixturePath in
158
202
let pkgPath = fixturePath. appending ( components: " AppPkg " )
159
203
let buildPath = try pkgPath. appending ( components: buildSystem. binPath ( for: configuration) )
@@ -163,19 +207,31 @@ struct ModuleAliasingFixtureTests {
163
207
extraArgs: [ " --vv " ] ,
164
208
buildSystem: buildSystem,
165
209
)
210
+ let expectedModules = [
211
+ " A.swiftmodule " ,
212
+ " BUtils.swiftmodule " ,
213
+ " CUtils.swiftmodule " ,
214
+ " XUtils.swiftmodule " ,
215
+ ]
166
216
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 " ) )
217
+ for file in expectedModules {
218
+ switch buildSystem {
219
+ case . native:
220
+ expectFileExists ( at: buildPath. appending ( components: " Modules " , file) )
221
+ case . swiftbuild:
222
+ expectFileExists ( at: buildPath. appending ( components: file) )
223
+ case . xcode:
224
+ Issue . record ( " expectations are not implemented " )
225
+ }
226
+ }
171
227
_ = try await executeSwiftBuild (
172
228
pkgPath,
173
229
configuration: configuration,
174
230
buildSystem: buildSystem,
175
231
)
176
232
}
177
233
} when: {
178
- buildSystem == . swiftbuild
234
+ ProcessInfo . hostOperatingSystem == . windows && buildSystem == . swiftbuild
179
235
}
180
236
}
181
237
}
0 commit comments