From a04666da602a229b3bc0c253558522255c7962dd Mon Sep 17 00:00:00 2001 From: Simon Edelmann Date: Sat, 29 Feb 2020 01:10:57 +0100 Subject: [PATCH] Use auto-detected tests on Linux --- Tests/CrudAPITests/CrudTests/CreateTests.swift | 7 ------- Tests/CrudAPITests/CrudTests/DeleteTests.swift | 5 ----- Tests/CrudAPITests/CrudTests/IndexAllTests.swift | 5 ----- Tests/CrudAPITests/CrudTests/IndexTests.swift | 6 ------ Tests/CrudAPITests/CrudTests/ReplaceTests.swift | 8 -------- Tests/CrudAPITests/XCTestManifests.swift | 13 ------------- Tests/LinuxMain.swift | 12 +----------- 7 files changed, 1 insertion(+), 55 deletions(-) delete mode 100644 Tests/CrudAPITests/XCTestManifests.swift diff --git a/Tests/CrudAPITests/CrudTests/CreateTests.swift b/Tests/CrudAPITests/CrudTests/CreateTests.swift index e65938e..f0a531c 100644 --- a/Tests/CrudAPITests/CrudTests/CreateTests.swift +++ b/Tests/CrudAPITests/CrudTests/CreateTests.swift @@ -92,11 +92,4 @@ final class CreateTests: ApplicationXCTestCase { XCTAssertNotEqual(res.status, .ok) } } - - static var allTests = [ - ("testCreateWithValidData", testCreateWithValidData), - ("testCreateWithoutData", testCreateWithoutData), - ("testCreateNonCreatableWithValidData", testCreateNonCreatableWithValidData), - ("testCreateWithInvalidData", testCreateWithInvalidData), - ] } diff --git a/Tests/CrudAPITests/CrudTests/DeleteTests.swift b/Tests/CrudAPITests/CrudTests/DeleteTests.swift index 9656fa8..8012ca1 100644 --- a/Tests/CrudAPITests/CrudTests/DeleteTests.swift +++ b/Tests/CrudAPITests/CrudTests/DeleteTests.swift @@ -40,9 +40,4 @@ final class DeleteTests: ApplicationXCTestCase { } } } - - static var allTests = [ - ("testDeleteWithValidId", testDeleteWithValidId), - ("testDeleteWithInvalidId", testDeleteWithInvalidId), - ] } diff --git a/Tests/CrudAPITests/CrudTests/IndexAllTests.swift b/Tests/CrudAPITests/CrudTests/IndexAllTests.swift index cd2ad85..96f0107 100644 --- a/Tests/CrudAPITests/CrudTests/IndexAllTests.swift +++ b/Tests/CrudAPITests/CrudTests/IndexAllTests.swift @@ -30,9 +30,4 @@ final class IndexAllTests: ApplicationXCTestCase { } } } - - static var allTests = [ - ("testEmptyIndexAll", testEmptyIndexAll), - ("testIndexAllContainingAllElements", testIndexAllContainingAllElements), - ] } diff --git a/Tests/CrudAPITests/CrudTests/IndexTests.swift b/Tests/CrudAPITests/CrudTests/IndexTests.swift index 3098619..e5a4bff 100644 --- a/Tests/CrudAPITests/CrudTests/IndexTests.swift +++ b/Tests/CrudAPITests/CrudTests/IndexTests.swift @@ -45,10 +45,4 @@ final class IndexTests: ApplicationXCTestCase { XCTAssertNotEqual(res.status, .ok) } } - - static var allTests = [ - ("testIndexWithoutID", testIndexWithoutID), - ("testIndexForGivenID", testIndexForGivenID), - ("testIndexForFakeID", testIndexForFakeID), - ] } diff --git a/Tests/CrudAPITests/CrudTests/ReplaceTests.swift b/Tests/CrudAPITests/CrudTests/ReplaceTests.swift index 91e3e81..74a7c9c 100644 --- a/Tests/CrudAPITests/CrudTests/ReplaceTests.swift +++ b/Tests/CrudAPITests/CrudTests/ReplaceTests.swift @@ -91,12 +91,4 @@ final class ReplaceTests: ApplicationXCTestCase { } } } - - static var allTests = [ - ("testReplaceForNonExistingObject", testReplaceForNonExistingObject), - ("testReplaceNonReplaceableForNonExistingObject", testReplaceNonReplaceableForNonExistingObject), - ("testReplaceWithValidData", testReplaceWithValidData), - ("testReplaceNonReplaceableWithValidData", testReplaceNonReplaceableWithValidData), - ("testReplaceWithInvalidData", testReplaceWithInvalidData), - ] } diff --git a/Tests/CrudAPITests/XCTestManifests.swift b/Tests/CrudAPITests/XCTestManifests.swift deleted file mode 100644 index 70245e2..0000000 --- a/Tests/CrudAPITests/XCTestManifests.swift +++ /dev/null @@ -1,13 +0,0 @@ -import XCTest - -#if !canImport(ObjectiveC) -public func allTests() -> [XCTestCaseEntry] { - return [ - testCase(RoutingTests.allTests), - testCase(IndexAllTests.allTests), - testCase(IndexTests.allTests), - testCase(CreateTests.allTests), - testCase(ReplaceTests.allTests), - ] -} -#endif diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift index 70896b9..c3e2227 100644 --- a/Tests/LinuxMain.swift +++ b/Tests/LinuxMain.swift @@ -1,11 +1 @@ -import XCTest - -import CrudAPITests - -var tests = [XCTestCaseEntry]() -tests += RoutingTests.allTests() -tests += IndexAllTests.allTests() -tests += IndexTests.allTests() -tests += CreateTests.allTests() -tests += ReplaceTests.allTests() -XCTMain(tests) +fatalError("Running tests like this is unsupported. Run the tests again by using `swift test --enable-test-discovery`")