Skip to content

Update the allTests declarations for compatibility with the latest Corelibs XCTest #158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Tests/Build/DescribeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@ final class DescribeTests: XCTestCase {
}
}

#if os(Linux)
extension DescribeTests: XCTestCaseProvider {
var allTests: [(String, () throws -> Void)] {
extension DescribeTests {
static var allTests: [(String, DescribeTests -> () throws -> Void)] {
return [
("testDescribingNoModulesThrows", testDescribingNoModulesThrows),
]
}
}
#endif
2 changes: 1 addition & 1 deletion Tests/Functional/TestModuleMaps.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class ModuleMapsTestCase: XCTestCase {


extension ModuleMapsTestCase {
var allTests : [(String, () throws -> Void)] {
static var allTests : [(String, ModuleMapsTestCase -> () throws -> Void)] {
return [
("testDirectDependency", testDirectDependency),
("testTransitiveDependency", testTransitiveDependency),
Expand Down
19 changes: 8 additions & 11 deletions Tests/Functional/TestValidLayouts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,8 @@ extension ValidLayoutsTestCase {
}


#if os(Linux)
extension DependencyResolutionTestCase: XCTestCaseProvider {
var allTests : [(String, () throws -> Void)] {
extension DependencyResolutionTestCase {
static var allTests : [(String, DependencyResolutionTestCase -> () throws -> Void)] {
return [
("testInternalSimple", testInternalSimple),
("testInternalComplex", testInternalComplex),
Expand All @@ -143,8 +142,8 @@ extension DependencyResolutionTestCase: XCTestCaseProvider {
}
}

extension InvalidLayoutsTestCase: XCTestCaseProvider {
var allTests : [(String, () throws -> Void)] {
extension InvalidLayoutsTestCase {
static var allTests : [(String, InvalidLayoutsTestCase -> () throws -> Void)] {
return [
("testNoTargets", testNoTargets),
("testMultipleRoots", testMultipleRoots),
Expand All @@ -157,8 +156,8 @@ extension InvalidLayoutsTestCase: XCTestCaseProvider {
}
}

extension MiscellaneousTestCase: XCTestCaseProvider {
var allTests : [(String, () throws -> Void)] {
extension MiscellaneousTestCase {
static var allTests : [(String, MiscellaneousTestCase -> () throws -> Void)] {
return [
("testPrintsSelectedDependencyVersion", testPrintsSelectedDependencyVersion),
("testManifestExcludes1", testManifestExcludes1),
Expand All @@ -183,9 +182,8 @@ extension MiscellaneousTestCase: XCTestCaseProvider {
}
}


extension ValidLayoutsTestCase: XCTestCaseProvider {
var allTests : [(String, () throws -> Void)] {
extension ValidLayoutsTestCase {
static var allTests : [(String, ValidLayoutsTestCase -> () throws -> Void)] {
return [
("testSingleModuleLibrary", testSingleModuleLibrary),
("testSingleModuleExecutable", testSingleModuleExecutable),
Expand All @@ -198,4 +196,3 @@ extension ValidLayoutsTestCase: XCTestCaseProvider {
]
}
}
#endif
14 changes: 6 additions & 8 deletions Tests/Get/RawCloneTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,8 @@ private func tryCloningRepoWithTag(tag: String?, shouldCrash: Bool) {
}


#if os(Linux)
extension VersionGraphTests: XCTestCaseProvider {
var allTests : [(String, () throws -> Void)] {
extension VersionGraphTests {
static var allTests : [(String, VersionGraphTests -> () throws -> Void)] {
return [
("testNoGraph", testNoGraph),
("testOneDependency", testOneDependency),
Expand All @@ -99,8 +98,8 @@ extension VersionGraphTests: XCTestCaseProvider {
}
}

extension GetTests: XCTestCaseProvider {
var allTests : [(String, () throws -> Void)] {
extension GetTests {
static var allTests : [(String, GetTests -> () throws -> Void)] {
return [
("testRawCloneDoesNotCrashIfManifestIsNotPresent", testRawCloneDoesNotCrashIfManifestIsNotPresent),
("testRangeConstrain", testRangeConstrain),
Expand All @@ -109,8 +108,8 @@ extension GetTests: XCTestCaseProvider {
}
}

extension GitTests: XCTestCaseProvider {
var allTests : [(String, () throws -> Void)] {
extension GitTests {
static var allTests : [(String, GitTests -> () throws -> Void)] {
return [
("testHasVersion", testHasVersion),
("testHasNoVersion", testHasNoVersion),
Expand All @@ -119,4 +118,3 @@ extension GitTests: XCTestCaseProvider {
]
}
}
#endif
50 changes: 25 additions & 25 deletions Tests/LinuxMain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,29 @@ import XCTest
@testable import Buildtest

XCTMain([
DependencyResolutionTestCase(),
FileTests(),
GetTests(),
GitTests(),
InvalidLayoutsTestCase(),
ManifestTests(),
MiscellaneousTestCase(),
ManifestParsertest.PackageTests(),
ModuleTests(),
PackageDescriptiontest.PackageTests(),
PackageTypetest.PackageTests(),
PathTests(),
RelativePathTests(),
ResourcesTests(),
ShellTests(),
StatTests(),
StringTests(),
TOMLTests(),
URLTests(),
ValidLayoutsTestCase(),
VersionGraphTests(),
VersionTests(),
WalkTests(),
ModuleMapsTestCase(),
DescribeTests(),
testCase(DependencyResolutionTestCase.allTests),
testCase(FileTests.allTests),
testCase(GetTests.allTests),
testCase(GitTests.allTests),
testCase(InvalidLayoutsTestCase.allTests),
testCase(ManifestTests.allTests),
testCase(MiscellaneousTestCase.allTests),
testCase(ManifestParsertest.PackageTests.allTests),
testCase(ModuleTests.allTests),
testCase(PackageDescriptiontest.PackageTests.allTests),
testCase(PackageTypetest.PackageTests.allTests),
testCase(PathTests.allTests),
testCase(RelativePathTests.allTests),
testCase(ResourcesTests.allTests),
testCase(ShellTests.allTests),
testCase(StatTests.allTests),
testCase(StringTests.allTests),
testCase(TOMLTests.allTests),
testCase(URLTests.allTests),
testCase(ValidLayoutsTestCase.allTests),
testCase(VersionGraphTests.allTests),
testCase(VersionTests.allTests),
testCase(WalkTests.allTests),
testCase(ModuleMapsTestCase.allTests),
testCase(DescribeTests.allTests),
])
14 changes: 6 additions & 8 deletions Tests/ManifestParser/TOMLTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@ class TOMLTests: XCTestCase {
}


#if os(Linux)
extension TOMLTests: XCTestCaseProvider {
var allTests : [(String, () throws -> Void)] {
extension TOMLTests {
static var allTests : [(String, TOMLTests -> () throws -> Void)] {
return [
("testLexer", testLexer),
("testParser", testParser),
Expand All @@ -119,16 +118,16 @@ extension TOMLTests: XCTestCaseProvider {
}
}

extension ManifestTests: XCTestCaseProvider {
var allTests : [(String, () throws -> Void)] {
extension ManifestTests {
static var allTests : [(String, ManifestTests -> () throws -> Void)] {
return [
("testManifestLoading", testManifestLoading),
]
}
}

extension PackageTests: XCTestCaseProvider {
var allTests : [(String, () throws -> Void)] {
extension PackageTests {
static var allTests : [(String, PackageTests -> () throws -> Void)] {
return [
("testBasics", testBasics),
("testExclude", testExclude),
Expand All @@ -138,4 +137,3 @@ extension PackageTests: XCTestCaseProvider {
]
}
}
#endif
8 changes: 2 additions & 6 deletions Tests/PackageDescription/PackageTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,10 @@ class PackageTests: XCTestCase {

}


#if os(Linux)
extension PackageTests: XCTestCaseProvider {
var allTests : [(String, () throws -> Void)] {
extension PackageTests {
static var allTests : [(String, PackageTests -> () throws -> Void)] {
return [
("testMatchDependencyWithPreReleaseVersion", testMatchDependencyWithPreReleaseVersion),

]
}
}
#endif
6 changes: 2 additions & 4 deletions Tests/PackageDescription/VersionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,8 @@ extension Array {
}


#if os(Linux)
extension VersionTests: XCTestCaseProvider {
var allTests : [(String, () throws -> Void)] {
extension VersionTests {
static var allTests : [(String, VersionTests -> () throws -> Void)] {
return [
("testEquality", testEquality),
("testNegativeValuesBecomeZero", testNegativeValuesBecomeZero),
Expand All @@ -326,4 +325,3 @@ extension VersionTests: XCTestCaseProvider {
]
}
}
#endif
6 changes: 2 additions & 4 deletions Tests/PackageType/PackageNameTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ class PackageTests: XCTestCase {
}


#if os(Linux)
extension PackageTests: XCTestCaseProvider {
var allTests : [(String, () throws -> Void)] {
extension PackageTests {
static var allTests : [(String, PackageTests -> () throws -> Void)] {
return [
("testUrlEndsInDotGit1", testUrlEndsInDotGit1),
("testUrlEndsInDotGit2", testUrlEndsInDotGit2),
Expand All @@ -46,4 +45,3 @@ extension PackageTests: XCTestCaseProvider {
]
}
}
#endif
6 changes: 2 additions & 4 deletions Tests/Transmute/ModuleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,8 @@ extension ModuleTests {
}


#if os(Linux)
extension ModuleTests: XCTestCaseProvider {
var allTests : [(String, () throws -> Void)] {
extension ModuleTests {
static var allTests : [(String, ModuleTests -> () throws -> Void)] {
return [
("test1", test1),
("test2", test2),
Expand All @@ -240,4 +239,3 @@ extension ModuleTests: XCTestCaseProvider {
]
}
}
#endif
42 changes: 20 additions & 22 deletions Tests/Utility/FileTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ class FileTests: XCTestCase {
}


#if os(Linux)
extension FileTests: XCTestCaseProvider {
var allTests : [(String, () throws -> Void)] {
extension FileTests {
static var allTests : [(String, FileTests -> () throws -> Void)] {
return [
("testOpenFile", testOpenFile),
("testOpenFileFail", testOpenFileFail),
Expand All @@ -82,16 +81,16 @@ extension FileTests: XCTestCaseProvider {
}


extension RmtreeTests: XCTestCaseProvider {
var allTests : [(String, () throws -> Void)] {
extension RmtreeTests {
static var allTests : [(String, RmtreeTests -> () throws -> Void)] {
return [
("testDoesNotFollowSymlinks", testDoesNotFollowSymlinks),
]
}
}

extension PathTests: XCTestCaseProvider {
var allTests : [(String, () throws -> Void)] {
extension PathTests {
static var allTests : [(String, PathTests -> () throws -> Void)] {
return [
("test", test),
("testPrecombined", testPrecombined),
Expand All @@ -104,8 +103,8 @@ extension PathTests: XCTestCaseProvider {
}
}

extension WalkTests: XCTestCaseProvider {
var allTests : [(String, () throws -> Void)] {
extension WalkTests {
static var allTests : [(String, WalkTests -> () throws -> Void)] {
return [
("testNonRecursive", testNonRecursive),
("testRecursive", testRecursive),
Expand All @@ -115,8 +114,8 @@ extension WalkTests: XCTestCaseProvider {
}
}

extension StatTests: XCTestCaseProvider {
var allTests : [(String, () throws -> Void)] {
extension StatTests {
static var allTests : [(String, StatTests -> () throws -> Void)] {
return [
("test_isdir", test_isdir),
("test_isfile", test_isfile),
Expand All @@ -126,8 +125,8 @@ extension StatTests: XCTestCaseProvider {
}
}

extension RelativePathTests: XCTestCaseProvider {
var allTests : [(String, () throws -> Void)] {
extension RelativePathTests {
static var allTests : [(String, RelativePathTests -> () throws -> Void)] {
return [
("testAbsolute", testAbsolute),
("testRelative", testRelative),
Expand All @@ -137,16 +136,16 @@ extension RelativePathTests: XCTestCaseProvider {
}


extension ResourcesTests: XCTestCaseProvider {
var allTests : [(String, () throws -> Void)] {
extension ResourcesTests {
static var allTests : [(String, ResourcesTests -> () throws -> Void)] {
return [
("testResources", testResources),
]
}
}

extension ShellTests: XCTestCaseProvider {
var allTests : [(String, () throws -> Void)] {
extension ShellTests {
static var allTests : [(String, ShellTests -> () throws -> Void)] {
return [
("testPopen", testPopen),
("testPopenWithBufferLargerThanThatAllocated", testPopenWithBufferLargerThanThatAllocated),
Expand All @@ -156,8 +155,8 @@ extension ShellTests: XCTestCaseProvider {
}


extension StringTests: XCTestCaseProvider {
var allTests : [(String, () throws -> Void)] {
extension StringTests {
static var allTests : [(String, StringTests -> () throws -> Void)] {
return [
("testTrailingChomp", testTrailingChomp),
("testEmptyChomp", testEmptyChomp),
Expand All @@ -168,11 +167,10 @@ extension StringTests: XCTestCaseProvider {

}

extension URLTests: XCTestCaseProvider {
var allTests : [(String, () throws -> Void)] {
extension URLTests {
static var allTests : [(String, URLTests -> () throws -> Void)] {
return [
("testSchema", testSchema),
]
}
}
#endif