Skip to content

Commit

Permalink
Regenerate LinuxMain with Swift 5 compiler and remove XCTestCaseProvider
Browse files Browse the repository at this point in the history
- `__allTests` is renamed to `__allTests_$className` so we can't access it statically
- Those definitions are now gated with `if !canImport(ObjectiveC)` so we can't access them on macOS
  • Loading branch information
ikesyo committed Sep 16, 2019
1 parent b35ec72 commit 76e057b
Show file tree
Hide file tree
Showing 35 changed files with 238 additions and 184 deletions.
12 changes: 0 additions & 12 deletions Nimble.xcodeproj/project.pbxproj
Expand Up @@ -281,9 +281,6 @@
29EA59641B551ED2002D767E /* ThrowErrorTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29EA59621B551ED2002D767E /* ThrowErrorTest.swift */; };
29EA59661B551EE6002D767E /* ThrowError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29EA59651B551EE6002D767E /* ThrowError.swift */; };
29EA59671B551EE6002D767E /* ThrowError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29EA59651B551EE6002D767E /* ThrowError.swift */; };
347155CA1C337C8900549F03 /* XCTestCaseProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 347155C91C337C8900549F03 /* XCTestCaseProvider.swift */; };
347155CB1C337C8900549F03 /* XCTestCaseProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 347155C91C337C8900549F03 /* XCTestCaseProvider.swift */; };
347155CC1C337C8900549F03 /* XCTestCaseProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 347155C91C337C8900549F03 /* XCTestCaseProvider.swift */; };
472FD1351B9E085700C7B8DA /* HaveCount.swift in Sources */ = {isa = PBXBuildFile; fileRef = 472FD1341B9E085700C7B8DA /* HaveCount.swift */; };
472FD1391B9E0A9700C7B8DA /* HaveCount.swift in Sources */ = {isa = PBXBuildFile; fileRef = 472FD1341B9E085700C7B8DA /* HaveCount.swift */; };
472FD13A1B9E0A9F00C7B8DA /* HaveCountTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 472FD1361B9E094B00C7B8DA /* HaveCountTest.swift */; };
Expand Down Expand Up @@ -350,7 +347,6 @@
B20058C520E92CE400C1264D /* ElementsEqualTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = B20058C420E92CE400C1264D /* ElementsEqualTest.swift */; };
B20058C620E92CE400C1264D /* ElementsEqualTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = B20058C420E92CE400C1264D /* ElementsEqualTest.swift */; };
B20058C720E92CE400C1264D /* ElementsEqualTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = B20058C420E92CE400C1264D /* ElementsEqualTest.swift */; };
CD037213207DCC580047AF28 /* XCTestManifests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD037212207DCC580047AF28 /* XCTestManifests.swift */; };
CD3D9A79232647BC00802581 /* CwlCatchBadInstructionPosix.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD3D9A78232647BC00802581 /* CwlCatchBadInstructionPosix.swift */; };
CD3D9A7A232648E600802581 /* CwlCatchException.h in Headers */ = {isa = PBXBuildFile; fileRef = CDFB6A221F7E07C600AD8CC7 /* CwlCatchException.h */; settings = {ATTRIBUTES = (Public, ); }; };
CD79C99E1D2CC832004B6F9A /* ObjCAsyncTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F4A56651A3B305F009E1637 /* ObjCAsyncTest.m */; };
Expand Down Expand Up @@ -590,7 +586,6 @@
1FE661561E6574E20035F243 /* ExpectationMessage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExpectationMessage.swift; sourceTree = "<group>"; };
29EA59621B551ED2002D767E /* ThrowErrorTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ThrowErrorTest.swift; sourceTree = "<group>"; };
29EA59651B551EE6002D767E /* ThrowError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ThrowError.swift; sourceTree = "<group>"; };
347155C91C337C8900549F03 /* XCTestCaseProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XCTestCaseProvider.swift; sourceTree = "<group>"; };
472FD1341B9E085700C7B8DA /* HaveCount.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HaveCount.swift; sourceTree = "<group>"; };
472FD1361B9E094B00C7B8DA /* HaveCountTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HaveCountTest.swift; sourceTree = "<group>"; };
4793854C1BA0BB2500296F85 /* ObjCHaveCountTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ObjCHaveCountTest.m; sourceTree = "<group>"; };
Expand All @@ -615,7 +610,6 @@
AE7ADE481C80C00D00B94CD3 /* MatchErrorTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MatchErrorTest.swift; sourceTree = "<group>"; };
B20058C020E92C7500C1264D /* ElementsEqual.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ElementsEqual.swift; sourceTree = "<group>"; };
B20058C420E92CE400C1264D /* ElementsEqualTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ElementsEqualTest.swift; sourceTree = "<group>"; };
CD037212207DCC580047AF28 /* XCTestManifests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XCTestManifests.swift; sourceTree = "<group>"; };
CD3D9A78232647BC00802581 /* CwlCatchBadInstructionPosix.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CwlCatchBadInstructionPosix.swift; sourceTree = "<group>"; };
CDFB6A1E1F7E07C600AD8CC7 /* CwlCatchException.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CwlCatchException.swift; sourceTree = "<group>"; };
CDFB6A201F7E07C600AD8CC7 /* CwlCatchException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CwlCatchException.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -691,7 +685,6 @@
children = (
1F14FB63194180C5009F2A08 /* utils.swift */,
1F0648CB19639F5A001F9C46 /* ObjectWithLazyProperty.swift */,
347155C91C337C8900549F03 /* XCTestCaseProvider.swift */,
);
path = Helpers;
sourceTree = "<group>";
Expand Down Expand Up @@ -773,7 +766,6 @@
1F0648D31963AAB2001F9C46 /* SynchronousTest.swift */,
965B0D0B1B62C06D0005AE66 /* UserDescriptionTest.swift */,
6CAEDD091CAEA86F003F1584 /* LinuxSupport.swift */,
CD037212207DCC580047AF28 /* XCTestManifests.swift */,
1FFD729A1963FC8200CD29A2 /* objc */,
1F14FB61194180A7009F2A08 /* Helpers */,
1F925EE3195C11B000ED456B /* Matchers */,
Expand Down Expand Up @@ -1436,7 +1428,6 @@
DD9A9A8F19CF439B00706F49 /* BeIdenticalToObjectTest.swift in Sources */,
1F4BB8B71DACA0E40048464B /* ThrowAssertionTest.swift in Sources */,
1F0648D41963AAB2001F9C46 /* SynchronousTest.swift in Sources */,
347155CA1C337C8900549F03 /* XCTestCaseProvider.swift in Sources */,
4793854D1BA0BB2500296F85 /* ObjCHaveCountTest.m in Sources */,
1F925F08195C18CF00ED456B /* BeGreaterThanTest.swift in Sources */,
7B5358BA1C3846C900A23FAA /* SatisfyAnyOfTest.swift in Sources */,
Expand Down Expand Up @@ -1569,7 +1560,6 @@
7A6AB2C41E7F547E00A2F694 /* ToSucceedTest.swift in Sources */,
CD79C9A71D2CC848004B6F9A /* ObjCBeGreaterThanTest.m in Sources */,
CD79C9A51D2CC848004B6F9A /* ObjCBeginWithTest.m in Sources */,
347155CC1C337C8900549F03 /* XCTestCaseProvider.swift in Sources */,
1F5DF1AA1BDCA10200C3A531 /* RaisesExceptionTest.swift in Sources */,
1F5DF1941BDCA10200C3A531 /* UserDescriptionTest.swift in Sources */,
CD79C9AF1D2CC848004B6F9A /* ObjCContainTest.m in Sources */,
Expand Down Expand Up @@ -1671,7 +1661,6 @@
DDB4D5F119FE442800E9D9FE /* MatchTest.swift in Sources */,
1F4A56741A3B3210009E1637 /* ObjCBeginWithTest.m in Sources */,
1F4A56831A3B336F009E1637 /* ObjCBeLessThanOrEqualToTest.m in Sources */,
CD037213207DCC580047AF28 /* XCTestManifests.swift in Sources */,
7B13BA0D1DD361DE00C9098C /* ContainElementSatisfyingTest.swift in Sources */,
1F925F03195C189500ED456B /* ContainTest.swift in Sources */,
A8A3B6FD2073644700E25A08 /* ObjcStringersTest.m in Sources */,
Expand Down Expand Up @@ -1714,7 +1703,6 @@
DD9A9A9019CF43AD00706F49 /* BeIdenticalToObjectTest.swift in Sources */,
1F4BB8B61DACA0E30048464B /* ThrowAssertionTest.swift in Sources */,
1F0648D51963AAB2001F9C46 /* SynchronousTest.swift in Sources */,
347155CB1C337C8900549F03 /* XCTestCaseProvider.swift in Sources */,
4793854E1BA0BB2500296F85 /* ObjCHaveCountTest.m in Sources */,
1F925F09195C18CF00ED456B /* BeGreaterThanTest.swift in Sources */,
7B5358BB1C3846C900A23FAA /* SatisfyAnyOfTest.swift in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion Tests/NimbleTests/AsynchronousTest.swift
Expand Up @@ -3,7 +3,7 @@ import Foundation
import XCTest
import Nimble

final class AsyncTest: XCTestCase, XCTestCaseProvider {
final class AsyncTest: XCTestCase {
class Error: Swift.Error {}
let errorToThrow = Error()

Expand Down
62 changes: 0 additions & 62 deletions Tests/NimbleTests/Helpers/XCTestCaseProvider.swift

This file was deleted.

2 changes: 1 addition & 1 deletion Tests/NimbleTests/Matchers/AllPassTest.swift
Expand Up @@ -42,7 +42,7 @@ extension Optional where Wrapped: Comparable {
}
}

final class AllPassTest: XCTestCase, XCTestCaseProvider {
final class AllPassTest: XCTestCase {
func testAllPassArray() {
expect([1, 2, 3, 4]).to(allPass({$0 < 5}))
expect([1, 2, 3, 4]).toNot(allPass({$0 > 5}))
Expand Down
4 changes: 2 additions & 2 deletions Tests/NimbleTests/Matchers/BeAKindOfTest.swift
Expand Up @@ -7,7 +7,7 @@ private protocol TestProtocol {}
private class TestClassConformingToProtocol: TestProtocol {}
private struct TestStructConformingToProtocol: TestProtocol {}

final class BeAKindOfSwiftTest: XCTestCase, XCTestCaseProvider {
final class BeAKindOfSwiftTest: XCTestCase {
enum TestEnum {
case one, two
}
Expand Down Expand Up @@ -47,7 +47,7 @@ final class BeAKindOfSwiftTest: XCTestCase, XCTestCaseProvider {
}
}

final class BeAKindOfObjCTest: XCTestCase, XCTestCaseProvider {
final class BeAKindOfObjCTest: XCTestCase {
func testPositiveMatch() {
#if canImport(Darwin)
expect(TestNull()).to(beAKindOf(NSNull.self))
Expand Down
2 changes: 1 addition & 1 deletion Tests/NimbleTests/Matchers/BeAnInstanceOfTest.swift
Expand Up @@ -6,7 +6,7 @@ private protocol TestProtocol {}
private class TestClassConformingToProtocol: TestProtocol {}
private struct TestStructConformingToProtocol: TestProtocol {}

final class BeAnInstanceOfTest: XCTestCase, XCTestCaseProvider {
final class BeAnInstanceOfTest: XCTestCase {
func testPositiveMatch() {
expect(NSNull()).to(beAnInstanceOf(NSNull.self))
expect(NSNumber(value: 1)).toNot(beAnInstanceOf(NSDate.self))
Expand Down
2 changes: 1 addition & 1 deletion Tests/NimbleTests/Matchers/BeCloseToTest.swift
Expand Up @@ -2,7 +2,7 @@ import Foundation
import XCTest
import Nimble

final class BeCloseToTest: XCTestCase, XCTestCaseProvider {
final class BeCloseToTest: XCTestCase {
func testBeCloseTo() {
expect(1.2).to(beCloseTo(1.2001))
expect(1.2 as CDouble).to(beCloseTo(1.2001))
Expand Down
2 changes: 1 addition & 1 deletion Tests/NimbleTests/Matchers/BeEmptyTest.swift
Expand Up @@ -2,7 +2,7 @@ import Foundation
import XCTest
import Nimble

final class BeEmptyTest: XCTestCase, XCTestCaseProvider {
final class BeEmptyTest: XCTestCase {
func testBeEmptyPositive() {
expect([] as [Int]).to(beEmpty())
expect([1]).toNot(beEmpty())
Expand Down
Expand Up @@ -2,7 +2,7 @@ import Foundation
import XCTest
import Nimble

final class BeGreaterThanOrEqualToTest: XCTestCase, XCTestCaseProvider {
final class BeGreaterThanOrEqualToTest: XCTestCase {
func testGreaterThanOrEqualTo() {
expect(10).to(beGreaterThanOrEqualTo(10))
expect(10).to(beGreaterThanOrEqualTo(2))
Expand Down
2 changes: 1 addition & 1 deletion Tests/NimbleTests/Matchers/BeGreaterThanTest.swift
Expand Up @@ -2,7 +2,7 @@ import Foundation
import XCTest
import Nimble

final class BeGreaterThanTest: XCTestCase, XCTestCaseProvider {
final class BeGreaterThanTest: XCTestCase {
func testGreaterThan() {
expect(10).to(beGreaterThan(2))
expect(1).toNot(beGreaterThan(2))
Expand Down
2 changes: 1 addition & 1 deletion Tests/NimbleTests/Matchers/BeIdenticalToObjectTest.swift
Expand Up @@ -2,7 +2,7 @@ import Foundation
import XCTest
import Nimble

final class BeIdenticalToObjectTest: XCTestCase, XCTestCaseProvider {
final class BeIdenticalToObjectTest: XCTestCase {
private class BeIdenticalToObjectTester {}
private let testObjectA = BeIdenticalToObjectTester()
private let testObjectB = BeIdenticalToObjectTester()
Expand Down
2 changes: 1 addition & 1 deletion Tests/NimbleTests/Matchers/BeIdenticalToTest.swift
Expand Up @@ -2,7 +2,7 @@ import Foundation
import XCTest
@testable import Nimble

final class BeIdenticalToTest: XCTestCase, XCTestCaseProvider {
final class BeIdenticalToTest: XCTestCase {
func testBeIdenticalToPositive() {
let value = NSDate()
expect(value).to(beIdenticalTo(value))
Expand Down
2 changes: 1 addition & 1 deletion Tests/NimbleTests/Matchers/BeLessThanOrEqualToTest.swift
Expand Up @@ -2,7 +2,7 @@ import Foundation
import XCTest
import Nimble

final class BeLessThanOrEqualToTest: XCTestCase, XCTestCaseProvider {
final class BeLessThanOrEqualToTest: XCTestCase {
func testLessThanOrEqualTo() {
expect(10).to(beLessThanOrEqualTo(10))
expect(2).to(beLessThanOrEqualTo(10))
Expand Down
2 changes: 1 addition & 1 deletion Tests/NimbleTests/Matchers/BeLessThanTest.swift
Expand Up @@ -2,7 +2,7 @@ import Foundation
import XCTest
import Nimble

final class BeLessThanTest: XCTestCase, XCTestCaseProvider {
final class BeLessThanTest: XCTestCase {
func testLessThan() {
expect(2).to(beLessThan(10))
expect(2).toNot(beLessThan(1))
Expand Down
8 changes: 4 additions & 4 deletions Tests/NimbleTests/Matchers/BeLogicalTest.swift
Expand Up @@ -29,7 +29,7 @@ enum ConvertsToBool: ExpressibleByBooleanLiteral, CustomStringConvertible {
}
}

final class BeTruthyTest: XCTestCase, XCTestCaseProvider {
final class BeTruthyTest: XCTestCase {
func testShouldMatchNonNilTypes() {
expect(true as Bool?).to(beTruthy())

Expand Down Expand Up @@ -110,7 +110,7 @@ final class BeTruthyTest: XCTestCase, XCTestCaseProvider {
}
}

final class BeTrueTest: XCTestCase, XCTestCaseProvider {
final class BeTrueTest: XCTestCase {
func testShouldMatchTrue() {
expect(true).to(beTrue())

Expand Down Expand Up @@ -138,7 +138,7 @@ final class BeTrueTest: XCTestCase, XCTestCaseProvider {
}
}

final class BeFalsyTest: XCTestCase, XCTestCaseProvider {
final class BeFalsyTest: XCTestCase {
func testShouldMatchNilTypes() {
expect(false as Bool?).to(beFalsy())

Expand Down Expand Up @@ -203,7 +203,7 @@ final class BeFalsyTest: XCTestCase, XCTestCaseProvider {
}
}

final class BeFalseTest: XCTestCase, XCTestCaseProvider {
final class BeFalseTest: XCTestCase {
func testShouldNotMatchTrue() {
expect(true).toNot(beFalse())

Expand Down
2 changes: 1 addition & 1 deletion Tests/NimbleTests/Matchers/BeNilTest.swift
@@ -1,7 +1,7 @@
import XCTest
import Nimble

final class BeNilTest: XCTestCase, XCTestCaseProvider {
final class BeNilTest: XCTestCase {
func producesNil() -> [Int]? {
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/NimbleTests/Matchers/BeVoidTest.swift
@@ -1,7 +1,7 @@
import XCTest
import Nimble

final class BeVoidTest: XCTestCase, XCTestCaseProvider {
final class BeVoidTest: XCTestCase {
func testBeVoid() {
expect(()).to(beVoid())
expect(() as ()?).to(beVoid())
Expand Down
2 changes: 1 addition & 1 deletion Tests/NimbleTests/Matchers/BeginWithTest.swift
Expand Up @@ -2,7 +2,7 @@ import Foundation
import XCTest
import Nimble

final class BeginWithTest: XCTestCase, XCTestCaseProvider {
final class BeginWithTest: XCTestCase {
func testPositiveMatches() {
expect([1, 2, 3]).to(beginWith(1))
expect([1, 2, 3]).toNot(beginWith(2))
Expand Down
Expand Up @@ -2,7 +2,7 @@ import Foundation
import XCTest
import Nimble

final class ContainElementSatisfyingTest: XCTestCase, XCTestCaseProvider {
final class ContainElementSatisfyingTest: XCTestCase {
func testContainElementSatisfying() {
var orderIndifferentArray = [1, 2, 3]
expect(orderIndifferentArray).to(containElementSatisfying({ number in
Expand Down
2 changes: 1 addition & 1 deletion Tests/NimbleTests/Matchers/ContainTest.swift
Expand Up @@ -2,7 +2,7 @@ import Foundation
import XCTest
import Nimble

final class ContainTest: XCTestCase, XCTestCaseProvider {
final class ContainTest: XCTestCase {
func testContainSequence() {
expect([1, 2, 3]).to(contain(1))
expect([1, 2, 3]).toNot(contain(4))
Expand Down
2 changes: 1 addition & 1 deletion Tests/NimbleTests/Matchers/ElementsEqualTest.swift
Expand Up @@ -2,7 +2,7 @@ import Foundation
import XCTest
import Nimble

final class ElementsEqualTest: XCTestCase, XCTestCaseProvider {
final class ElementsEqualTest: XCTestCase {

func testSequenceElementsEquality() {
failsWithErrorMessageForNil("expected to elementsEqual <nil>, got <nil>") {
Expand Down
2 changes: 1 addition & 1 deletion Tests/NimbleTests/Matchers/EndWithTest.swift
Expand Up @@ -2,7 +2,7 @@ import Foundation
import XCTest
import Nimble

final class EndWithTest: XCTestCase, XCTestCaseProvider {
final class EndWithTest: XCTestCase {
func testEndWithPositives() {
expect([1, 2, 3]).to(endWith(3))
expect([1, 2, 3]).toNot(endWith(2))
Expand Down
2 changes: 1 addition & 1 deletion Tests/NimbleTests/Matchers/EqualTest.swift
Expand Up @@ -2,7 +2,7 @@ import Foundation
import XCTest
import Nimble

final class EqualTest: XCTestCase, XCTestCaseProvider {
final class EqualTest: XCTestCase {
func testEquality() {
expect(1 as CInt).to(equal(1 as CInt))
expect(1 as CInt).to(equal(1))
Expand Down
2 changes: 1 addition & 1 deletion Tests/NimbleTests/Matchers/HaveCountTest.swift
@@ -1,7 +1,7 @@
import XCTest
import Nimble

final class HaveCountTest: XCTestCase, XCTestCaseProvider {
final class HaveCountTest: XCTestCase {
func testHaveCountForArray() {
expect([1, 2, 3]).to(haveCount(3))
expect([1, 2, 3]).notTo(haveCount(1))
Expand Down
2 changes: 1 addition & 1 deletion Tests/NimbleTests/Matchers/MatchErrorTest.swift
Expand Up @@ -2,7 +2,7 @@ import Foundation
import XCTest
import Nimble

final class MatchErrorTest: XCTestCase, XCTestCaseProvider {
final class MatchErrorTest: XCTestCase {
func testMatchErrorPositive() {
expect(NimbleError.laugh).to(matchError(NimbleError.laugh))
expect(NimbleError.laugh).to(matchError(NimbleError.self))
Expand Down
2 changes: 1 addition & 1 deletion Tests/NimbleTests/Matchers/MatchTest.swift
@@ -1,7 +1,7 @@
import XCTest
import Nimble

final class MatchTest: XCTestCase, XCTestCaseProvider {
final class MatchTest: XCTestCase {
func testMatchPositive() {
expect("11:14").to(match("\\d{2}:\\d{2}"))
}
Expand Down

0 comments on commit 76e057b

Please sign in to comment.