2020/// A test run collects information about the execution of a test. Failures in
2121/// explicit test assertions are classified as "expected", while failures from
2222/// unrelated or uncaught exceptions are classified as "unexpected".
23- public class XCTestRun {
23+ open class XCTestRun {
2424 /// The test instance provided when the test run was initialized.
2525 public let test : XCTest
2626
2727 /// The time at which the test run was started, or nil.
28- public private( set) var startDate : Date ?
28+ open private( set) var startDate : Date ?
2929
3030 /// The time at which the test run was stopped, or nil.
31- public private( set) var stopDate : Date ?
31+ open private( set) var stopDate : Date ?
3232
3333 /// The number of seconds that elapsed between when the run was started and
3434 /// when it was stopped.
35- public var totalDuration : TimeInterval {
35+ open var totalDuration : TimeInterval {
3636 if let stop = stopDate, let start = startDate {
3737 return stop. timeIntervalSince ( start)
3838 } else {
@@ -43,33 +43,33 @@ public class XCTestRun {
4343 /// In an `XCTestCase` run, the number of seconds that elapsed between when
4444 /// the run was started and when it was stopped. In an `XCTestSuite` run,
4545 /// the combined `testDuration` of each test case in the suite.
46- public var testDuration : TimeInterval {
46+ open var testDuration : TimeInterval {
4747 return totalDuration
4848 }
4949
5050 /// The number of tests in the run.
51- public var testCaseCount : UInt {
51+ open var testCaseCount : UInt {
5252 return test. testCaseCount
5353 }
5454
5555 /// The number of test executions recorded during the run.
56- public private( set) var executionCount : UInt = 0
56+ open private( set) var executionCount : UInt = 0
5757
5858 /// The number of test failures recorded during the run.
59- public private( set) var failureCount : UInt = 0
59+ open private( set) var failureCount : UInt = 0
6060
6161 /// The number of uncaught exceptions recorded during the run.
62- public private( set) var unexpectedExceptionCount : UInt = 0
62+ open private( set) var unexpectedExceptionCount : UInt = 0
6363
6464 /// The total number of test failures and uncaught exceptions recorded
6565 /// during the run.
66- public var totalFailureCount : UInt {
66+ open var totalFailureCount : UInt {
6767 return failureCount + unexpectedExceptionCount
6868 }
6969
7070 /// `true` if all tests in the run completed their execution without
7171 /// recording any failures, otherwise `false`.
72- public var hasSucceeded : Bool {
72+ open var hasSucceeded : Bool {
7373 guard isStopped else {
7474 return false
7575 }
@@ -84,7 +84,7 @@ public class XCTestRun {
8484 }
8585
8686 /// Start a test run. Must not be called more than once.
87- public func start( ) {
87+ open func start( ) {
8888 guard !isStarted else {
8989 fatalError ( " Invalid attempt to start a test run that has " +
9090 " already been started: \( self ) " )
@@ -99,7 +99,7 @@ public class XCTestRun {
9999
100100 /// Stop a test run. Must not be called unless the run has been started.
101101 /// Must not be called more than once.
102- public func stop( ) {
102+ open func stop( ) {
103103 guard isStarted else {
104104 fatalError ( " Invalid attempt to stop a test run that has " +
105105 " not yet been started: \( self ) " )
0 commit comments