Skip to content

Commit cb48cc7

Browse files
committed
Add an XCTestCase class, renaming the protocol to XCTestCaseType
1 parent e2a5e1e commit cb48cc7

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

Sources/XCTest/XCTestCase.swift

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
// Base protocol (and extension with default methods) for test cases
1212
//
1313

14-
public protocol XCTestCase : XCTestCaseProvider {
14+
public protocol XCTestCaseType : XCTestCaseProvider {
1515
func setUp()
1616
func tearDown()
1717
}
1818

19-
extension XCTestCase {
2019

20+
extension XCTestCaseType {
2121
public var continueAfterFailure: Bool {
2222
get {
2323
return true
@@ -99,3 +99,18 @@ extension XCTestCase {
9999

100100
}
101101
}
102+
103+
public class XCTestCase {
104+
105+
public init() {
106+
107+
}
108+
109+
public func setUp() {
110+
111+
}
112+
113+
public func tearDown() {
114+
115+
}
116+
}

Sources/XCTest/XCTestMain.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ internal struct XCTRun {
4444
///
4545
/// This function will not return. If the test cases pass, then it will call `exit(0)`. If there is a failure, then it will call `exit(1)`.
4646
/// - Parameter testCases: An array of test cases to run.
47-
@noreturn public func XCTMain(testCases: [XCTestCase]) {
47+
@noreturn public func XCTMain(testCases: [XCTestCaseType]) {
4848
let overallDuration = measureTimeExecutingBlock {
4949
for testCase in testCases {
5050
testCase.invokeTest()

0 commit comments

Comments
 (0)