Skip to content

Commit 235f5dd

Browse files
author
Mike Ferris
committed
Merge pull request #158 from briancroom/update_allTests
Update the allTests declarations for compatibility with the latest Corelibs XCTest
2 parents 9cb55e8 + f9ce7ee commit 235f5dd

File tree

11 files changed

+76
-97
lines changed

11 files changed

+76
-97
lines changed

Tests/Build/DescribeTests.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ final class DescribeTests: XCTestCase {
2424
}
2525
}
2626

27-
#if os(Linux)
28-
extension DescribeTests: XCTestCaseProvider {
29-
var allTests: [(String, () throws -> Void)] {
27+
extension DescribeTests {
28+
static var allTests: [(String, DescribeTests -> () throws -> Void)] {
3029
return [
3130
("testDescribingNoModulesThrows", testDescribingNoModulesThrows),
3231
]
3332
}
3433
}
35-
#endif

Tests/Functional/TestModuleMaps.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class ModuleMapsTestCase: XCTestCase {
7272

7373

7474
extension ModuleMapsTestCase {
75-
var allTests : [(String, () throws -> Void)] {
75+
static var allTests : [(String, ModuleMapsTestCase -> () throws -> Void)] {
7676
return [
7777
("testDirectDependency", testDirectDependency),
7878
("testTransitiveDependency", testTransitiveDependency),

Tests/Functional/TestValidLayouts.swift

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,8 @@ extension ValidLayoutsTestCase {
131131
}
132132

133133

134-
#if os(Linux)
135-
extension DependencyResolutionTestCase: XCTestCaseProvider {
136-
var allTests : [(String, () throws -> Void)] {
134+
extension DependencyResolutionTestCase {
135+
static var allTests : [(String, DependencyResolutionTestCase -> () throws -> Void)] {
137136
return [
138137
("testInternalSimple", testInternalSimple),
139138
("testInternalComplex", testInternalComplex),
@@ -143,8 +142,8 @@ extension DependencyResolutionTestCase: XCTestCaseProvider {
143142
}
144143
}
145144

146-
extension InvalidLayoutsTestCase: XCTestCaseProvider {
147-
var allTests : [(String, () throws -> Void)] {
145+
extension InvalidLayoutsTestCase {
146+
static var allTests : [(String, InvalidLayoutsTestCase -> () throws -> Void)] {
148147
return [
149148
("testNoTargets", testNoTargets),
150149
("testMultipleRoots", testMultipleRoots),
@@ -157,8 +156,8 @@ extension InvalidLayoutsTestCase: XCTestCaseProvider {
157156
}
158157
}
159158

160-
extension MiscellaneousTestCase: XCTestCaseProvider {
161-
var allTests : [(String, () throws -> Void)] {
159+
extension MiscellaneousTestCase {
160+
static var allTests : [(String, MiscellaneousTestCase -> () throws -> Void)] {
162161
return [
163162
("testPrintsSelectedDependencyVersion", testPrintsSelectedDependencyVersion),
164163
("testManifestExcludes1", testManifestExcludes1),
@@ -183,9 +182,8 @@ extension MiscellaneousTestCase: XCTestCaseProvider {
183182
}
184183
}
185184

186-
187-
extension ValidLayoutsTestCase: XCTestCaseProvider {
188-
var allTests : [(String, () throws -> Void)] {
185+
extension ValidLayoutsTestCase {
186+
static var allTests : [(String, ValidLayoutsTestCase -> () throws -> Void)] {
189187
return [
190188
("testSingleModuleLibrary", testSingleModuleLibrary),
191189
("testSingleModuleExecutable", testSingleModuleExecutable),
@@ -198,4 +196,3 @@ extension ValidLayoutsTestCase: XCTestCaseProvider {
198196
]
199197
}
200198
}
201-
#endif

Tests/Get/RawCloneTests.swift

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,8 @@ private func tryCloningRepoWithTag(tag: String?, shouldCrash: Bool) {
7878
}
7979

8080

81-
#if os(Linux)
82-
extension VersionGraphTests: XCTestCaseProvider {
83-
var allTests : [(String, () throws -> Void)] {
81+
extension VersionGraphTests {
82+
static var allTests : [(String, VersionGraphTests -> () throws -> Void)] {
8483
return [
8584
("testNoGraph", testNoGraph),
8685
("testOneDependency", testOneDependency),
@@ -99,8 +98,8 @@ extension VersionGraphTests: XCTestCaseProvider {
9998
}
10099
}
101100

102-
extension GetTests: XCTestCaseProvider {
103-
var allTests : [(String, () throws -> Void)] {
101+
extension GetTests {
102+
static var allTests : [(String, GetTests -> () throws -> Void)] {
104103
return [
105104
("testRawCloneDoesNotCrashIfManifestIsNotPresent", testRawCloneDoesNotCrashIfManifestIsNotPresent),
106105
("testRangeConstrain", testRangeConstrain),
@@ -109,8 +108,8 @@ extension GetTests: XCTestCaseProvider {
109108
}
110109
}
111110

112-
extension GitTests: XCTestCaseProvider {
113-
var allTests : [(String, () throws -> Void)] {
111+
extension GitTests {
112+
static var allTests : [(String, GitTests -> () throws -> Void)] {
114113
return [
115114
("testHasVersion", testHasVersion),
116115
("testHasNoVersion", testHasNoVersion),
@@ -119,4 +118,3 @@ extension GitTests: XCTestCaseProvider {
119118
]
120119
}
121120
}
122-
#endif

Tests/LinuxMain.swift

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,29 @@ import XCTest
1515
@testable import Buildtest
1616

1717
XCTMain([
18-
DependencyResolutionTestCase(),
19-
FileTests(),
20-
GetTests(),
21-
GitTests(),
22-
InvalidLayoutsTestCase(),
23-
ManifestTests(),
24-
MiscellaneousTestCase(),
25-
ManifestParsertest.PackageTests(),
26-
ModuleTests(),
27-
PackageDescriptiontest.PackageTests(),
28-
PackageTypetest.PackageTests(),
29-
PathTests(),
30-
RelativePathTests(),
31-
ResourcesTests(),
32-
ShellTests(),
33-
StatTests(),
34-
StringTests(),
35-
TOMLTests(),
36-
URLTests(),
37-
ValidLayoutsTestCase(),
38-
VersionGraphTests(),
39-
VersionTests(),
40-
WalkTests(),
41-
ModuleMapsTestCase(),
42-
DescribeTests(),
18+
testCase(DependencyResolutionTestCase.allTests),
19+
testCase(FileTests.allTests),
20+
testCase(GetTests.allTests),
21+
testCase(GitTests.allTests),
22+
testCase(InvalidLayoutsTestCase.allTests),
23+
testCase(ManifestTests.allTests),
24+
testCase(MiscellaneousTestCase.allTests),
25+
testCase(ManifestParsertest.PackageTests.allTests),
26+
testCase(ModuleTests.allTests),
27+
testCase(PackageDescriptiontest.PackageTests.allTests),
28+
testCase(PackageTypetest.PackageTests.allTests),
29+
testCase(PathTests.allTests),
30+
testCase(RelativePathTests.allTests),
31+
testCase(ResourcesTests.allTests),
32+
testCase(ShellTests.allTests),
33+
testCase(StatTests.allTests),
34+
testCase(StringTests.allTests),
35+
testCase(TOMLTests.allTests),
36+
testCase(URLTests.allTests),
37+
testCase(ValidLayoutsTestCase.allTests),
38+
testCase(VersionGraphTests.allTests),
39+
testCase(VersionTests.allTests),
40+
testCase(WalkTests.allTests),
41+
testCase(ModuleMapsTestCase.allTests),
42+
testCase(DescribeTests.allTests),
4343
])

Tests/ManifestParser/TOMLTests.swift

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,8 @@ class TOMLTests: XCTestCase {
108108
}
109109

110110

111-
#if os(Linux)
112-
extension TOMLTests: XCTestCaseProvider {
113-
var allTests : [(String, () throws -> Void)] {
111+
extension TOMLTests {
112+
static var allTests : [(String, TOMLTests -> () throws -> Void)] {
114113
return [
115114
("testLexer", testLexer),
116115
("testParser", testParser),
@@ -119,16 +118,16 @@ extension TOMLTests: XCTestCaseProvider {
119118
}
120119
}
121120

122-
extension ManifestTests: XCTestCaseProvider {
123-
var allTests : [(String, () throws -> Void)] {
121+
extension ManifestTests {
122+
static var allTests : [(String, ManifestTests -> () throws -> Void)] {
124123
return [
125124
("testManifestLoading", testManifestLoading),
126125
]
127126
}
128127
}
129128

130-
extension PackageTests: XCTestCaseProvider {
131-
var allTests : [(String, () throws -> Void)] {
129+
extension PackageTests {
130+
static var allTests : [(String, PackageTests -> () throws -> Void)] {
132131
return [
133132
("testBasics", testBasics),
134133
("testExclude", testExclude),
@@ -138,4 +137,3 @@ extension PackageTests: XCTestCaseProvider {
138137
]
139138
}
140139
}
141-
#endif

Tests/PackageDescription/PackageTests.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,10 @@ class PackageTests: XCTestCase {
2929

3030
}
3131

32-
33-
#if os(Linux)
34-
extension PackageTests: XCTestCaseProvider {
35-
var allTests : [(String, () throws -> Void)] {
32+
extension PackageTests {
33+
static var allTests : [(String, PackageTests -> () throws -> Void)] {
3634
return [
3735
("testMatchDependencyWithPreReleaseVersion", testMatchDependencyWithPreReleaseVersion),
38-
3936
]
4037
}
4138
}
42-
#endif

Tests/PackageDescription/VersionTests.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,8 @@ extension Array {
309309
}
310310

311311

312-
#if os(Linux)
313-
extension VersionTests: XCTestCaseProvider {
314-
var allTests : [(String, () throws -> Void)] {
312+
extension VersionTests {
313+
static var allTests : [(String, VersionTests -> () throws -> Void)] {
315314
return [
316315
("testEquality", testEquality),
317316
("testNegativeValuesBecomeZero", testNegativeValuesBecomeZero),
@@ -326,4 +325,3 @@ extension VersionTests: XCTestCaseProvider {
326325
]
327326
}
328327
}
329-
#endif

Tests/PackageType/PackageNameTests.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ class PackageTests: XCTestCase {
3535
}
3636

3737

38-
#if os(Linux)
39-
extension PackageTests: XCTestCaseProvider {
40-
var allTests : [(String, () throws -> Void)] {
38+
extension PackageTests {
39+
static var allTests : [(String, PackageTests -> () throws -> Void)] {
4140
return [
4241
("testUrlEndsInDotGit1", testUrlEndsInDotGit1),
4342
("testUrlEndsInDotGit2", testUrlEndsInDotGit2),
@@ -46,4 +45,3 @@ extension PackageTests: XCTestCaseProvider {
4645
]
4746
}
4847
}
49-
#endif

Tests/Transmute/ModuleTests.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,8 @@ extension ModuleTests {
224224
}
225225

226226

227-
#if os(Linux)
228-
extension ModuleTests: XCTestCaseProvider {
229-
var allTests : [(String, () throws -> Void)] {
227+
extension ModuleTests {
228+
static var allTests : [(String, ModuleTests -> () throws -> Void)] {
230229
return [
231230
("test1", test1),
232231
("test2", test2),
@@ -240,4 +239,3 @@ extension ModuleTests: XCTestCaseProvider {
240239
]
241240
}
242241
}
243-
#endif

Tests/Utility/FileTests.swift

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,8 @@ class FileTests: XCTestCase {
6969
}
7070

7171

72-
#if os(Linux)
73-
extension FileTests: XCTestCaseProvider {
74-
var allTests : [(String, () throws -> Void)] {
72+
extension FileTests {
73+
static var allTests : [(String, FileTests -> () throws -> Void)] {
7574
return [
7675
("testOpenFile", testOpenFile),
7776
("testOpenFileFail", testOpenFileFail),
@@ -82,16 +81,16 @@ extension FileTests: XCTestCaseProvider {
8281
}
8382

8483

85-
extension RmtreeTests: XCTestCaseProvider {
86-
var allTests : [(String, () throws -> Void)] {
84+
extension RmtreeTests {
85+
static var allTests : [(String, RmtreeTests -> () throws -> Void)] {
8786
return [
8887
("testDoesNotFollowSymlinks", testDoesNotFollowSymlinks),
8988
]
9089
}
9190
}
9291

93-
extension PathTests: XCTestCaseProvider {
94-
var allTests : [(String, () throws -> Void)] {
92+
extension PathTests {
93+
static var allTests : [(String, PathTests -> () throws -> Void)] {
9594
return [
9695
("test", test),
9796
("testPrecombined", testPrecombined),
@@ -104,8 +103,8 @@ extension PathTests: XCTestCaseProvider {
104103
}
105104
}
106105

107-
extension WalkTests: XCTestCaseProvider {
108-
var allTests : [(String, () throws -> Void)] {
106+
extension WalkTests {
107+
static var allTests : [(String, WalkTests -> () throws -> Void)] {
109108
return [
110109
("testNonRecursive", testNonRecursive),
111110
("testRecursive", testRecursive),
@@ -115,8 +114,8 @@ extension WalkTests: XCTestCaseProvider {
115114
}
116115
}
117116

118-
extension StatTests: XCTestCaseProvider {
119-
var allTests : [(String, () throws -> Void)] {
117+
extension StatTests {
118+
static var allTests : [(String, StatTests -> () throws -> Void)] {
120119
return [
121120
("test_isdir", test_isdir),
122121
("test_isfile", test_isfile),
@@ -126,8 +125,8 @@ extension StatTests: XCTestCaseProvider {
126125
}
127126
}
128127

129-
extension RelativePathTests: XCTestCaseProvider {
130-
var allTests : [(String, () throws -> Void)] {
128+
extension RelativePathTests {
129+
static var allTests : [(String, RelativePathTests -> () throws -> Void)] {
131130
return [
132131
("testAbsolute", testAbsolute),
133132
("testRelative", testRelative),
@@ -137,16 +136,16 @@ extension RelativePathTests: XCTestCaseProvider {
137136
}
138137

139138

140-
extension ResourcesTests: XCTestCaseProvider {
141-
var allTests : [(String, () throws -> Void)] {
139+
extension ResourcesTests {
140+
static var allTests : [(String, ResourcesTests -> () throws -> Void)] {
142141
return [
143142
("testResources", testResources),
144143
]
145144
}
146145
}
147146

148-
extension ShellTests: XCTestCaseProvider {
149-
var allTests : [(String, () throws -> Void)] {
147+
extension ShellTests {
148+
static var allTests : [(String, ShellTests -> () throws -> Void)] {
150149
return [
151150
("testPopen", testPopen),
152151
("testPopenWithBufferLargerThanThatAllocated", testPopenWithBufferLargerThanThatAllocated),
@@ -156,8 +155,8 @@ extension ShellTests: XCTestCaseProvider {
156155
}
157156

158157

159-
extension StringTests: XCTestCaseProvider {
160-
var allTests : [(String, () throws -> Void)] {
158+
extension StringTests {
159+
static var allTests : [(String, StringTests -> () throws -> Void)] {
161160
return [
162161
("testTrailingChomp", testTrailingChomp),
163162
("testEmptyChomp", testEmptyChomp),
@@ -168,11 +167,10 @@ extension StringTests: XCTestCaseProvider {
168167

169168
}
170169

171-
extension URLTests: XCTestCaseProvider {
172-
var allTests : [(String, () throws -> Void)] {
170+
extension URLTests {
171+
static var allTests : [(String, URLTests -> () throws -> Void)] {
173172
return [
174173
("testSchema", testSchema),
175174
]
176175
}
177176
}
178-
#endif

0 commit comments

Comments
 (0)