---
title: XCTestRun
framework: xctest
role: symbol
role_heading: Class
path: xctest/xctestrun
---

# XCTestRun

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

## Declaration

```swift
class XCTestRun
```

## Overview

Overview XCTestRun classifies failures in explicit test assertions as expected, and failures from unrelated or uncaught exceptions as unexpected.

## Topics

### Creating Test Runs

- [init(test:)](xctest/xctestrun/init(test:).md)

### Performing Test Runs

- [start()](xctest/xctestrun/start().md)
- [stop()](xctest/xctestrun/stop().md)
- [record(_:)](xctest/xctestrun/record(_:).md)

### Tracking Test Durations

- [startDate](xctest/xctestrun/startdate.md)
- [stopDate](xctest/xctestrun/stopdate.md)
- [testDuration](xctest/xctestrun/testduration.md)
- [totalDuration](xctest/xctestrun/totalduration.md)

### Gathering Test Outcomes

- [hasSucceeded](xctest/xctestrun/hassucceeded.md)
- [hasBeenSkipped](xctest/xctestrun/hasbeenskipped.md)
- [executionCount](xctest/xctestrun/executioncount.md)
- [failureCount](xctest/xctestrun/failurecount.md)
- [skipCount](xctest/xctestrun/skipcount.md)
- [test](xctest/xctestrun/test.md)
- [testCaseCount](xctest/xctestrun/testcasecount.md)
- [totalFailureCount](xctest/xctestrun/totalfailurecount.md)
- [unexpectedExceptionCount](xctest/xctestrun/unexpectedexceptioncount.md)

### Deprecated

- [recordFailure(withDescription:inFile:atLine:expected:)](xctest/xctestrun/recordfailure(withdescription:infile:atline:expected:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Inherited By

- [XCTestCaseRun](xctest/xctestcaserun.md)
- [XCTestSuiteRun](xctest/xctestsuiterun.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Test Runs

- [XCTestCaseRun](xctest/xctestcaserun.md)
- [XCTestSuiteRun](xctest/xctestsuiterun.md)
