XCTestRun Class Reference
| Inherits from | NSObject |
|---|---|
| Declared in | XCTestRun.h |
Overview
@class XCTestRun A test run collects information about the execution of a test. Failures in explicit test assertions are classified as “expected”, while failures from unrelated or uncaught exceptions are classified as “unexpected”.
test
@property test The test instance provided when the test run was initialized.
@property (readonly, strong) XCTest *testDeclared In
XCTestRun.h
– start
@method -start Start a test run. Must not be called more than once.
- (void)startDeclared In
XCTestRun.h
– stop
@method -stop Stop a test run. Must not be called unless the run has been started. Must not be called more than once.
- (void)stopDeclared In
XCTestRun.h
startDate
@property startDate The time at which the test run was started, or nil.
@property (readonly, copy, nullable) NSDate *startDateDeclared In
XCTestRun.h
stopDate
@property stopDate The time at which the test run was stopped, or nil.
@property (readonly, copy, nullable) NSDate *stopDateDeclared In
XCTestRun.h
totalDuration
@property totalDuration The number of seconds that elapsed between when the run was started and when it was stopped.
@property (readonly) NSTimeInterval totalDurationDeclared In
XCTestRun.h
testDuration
@property testDuration The number of seconds that elapsed between when the run was started and when it was stopped.
@property (readonly) NSTimeInterval testDurationDeclared In
XCTestRun.h
testCaseCount
@property testCaseCount The number of tests in the run.
@property (readonly) NSUInteger testCaseCountDeclared In
XCTestRun.h
executionCount
@property executionCount The number of test executions recorded during the run.
@property (readonly) NSUInteger executionCountDeclared In
XCTestRun.h
failureCount
@property failureCount The number of test failures recorded during the run.
@property (readonly) NSUInteger failureCountDeclared In
XCTestRun.h
unexpectedExceptionCount
@property unexpectedExceptionCount The number of uncaught exceptions recorded during the run.
@property (readonly) NSUInteger unexpectedExceptionCountDeclared In
XCTestRun.h
totalFailureCount
@property totalFailureCount The total number of test failures and uncaught exceptions recorded during the run.
@property (readonly) NSUInteger totalFailureCountDeclared In
XCTestRun.h
hasSucceeded
@property hasSucceeded YES if all tests in the run completed their execution without recording any failures, otherwise NO.
@property (readonly) BOOL hasSucceededDeclared In
XCTestRun.h
– recordFailureWithDescription:inFile:atLine:expected:
@method -recordFailureWithDescription:inFile:atLine:expected: Records a failure in the execution of the test for this test run. Must not be called unless the run has been started. Must not be called if the test run has been stopped.
- (void)recordFailureWithDescription:(NSString *)description inFile:(nullable NSString *)filePath atLine:(NSUInteger)lineNumber expected:(BOOL)expectedParameters
description |
The description of the failure being reported. |
|---|---|
filePath |
The file path to the source file where the failure being reported was encountered or nil if unknown. |
lineNumber |
The line number in the source file at filePath where the failure being reported was encountered. |
expected |
YES if the failure being reported was the result of a failed assertion, NO if it was the result of an uncaught exception. |
Declared In
XCTestRun.h