Class

XCTestRun

A base class for collecting information about a specific execution of an XCTest.

Declaration

@interface XCTestRun : NSObject

Overview

Failures in explicit test assertions are classified as "expected", while failures from unrelated or uncaught exceptions are classified as "unexpected".

Topics

Creating Test Runs

- initWithTest:

Creates a new XCTestRun for the provided test.

+ testRunWithTest:

Creates a new XCTestRun for the provided test.

Performing Test Runs

- start

Starts a test run.

- stop

Stops a test run.

- recordFailureWithDescription:inFile:atLine:expected:

Records a failure in the execution of the test for this test run.

Test Duration

startDate

The time at which the test run was started, or nil if the test has not yet run.

stopDate

The time at which the test run was stopped, or nil if the test has not yet run.

testDuration

The number of seconds that elapsed between when the run was started and when it was stopped.

totalDuration

The number of seconds that elapsed between when the run was started and when it was stopped.

Test Outcomes

hasSucceeded

YES if all tests in the run completed their execution without recording any failures, otherwise NO.

executionCount

The number of test executions recorded during the run.

failureCount

The number of test failures recorded during the run.

test

The test instance provided when the test run was initialized.

testCaseCount

The number of tests in the run.

totalFailureCount

The total number of test failures and uncaught exceptions recorded during the run.

unexpectedExceptionCount

The number of uncaught exceptions recorded during the run.

Relationships

Inherits From

See Also

Test Runs

XCTestCaseRun

Collects information about a specific execution of an XCTestCase.

XCTestSuiteRun

Collects information about a specific execution of an XCTestSuite.