XCTestObservation
A protocol that defines methods the test runner calls in response to significant events during test runs.
Declaration
protocol XCTestObservation : NSObjectProtocolOverview
The system calls the notification methods for XCTestObservation in the following sequence for a test bundle:
testBundleWillStart(_:) — exactly once per test bundle
testSuiteWillStart(_:) — exactly once per test suite
testCaseWillStart(_:) — exactly once per test case
testCase(_:didRecord:) — for each test failure, zero or more times per test case at any point between test case start and finish
testCase(_:didRecord:) — for each expected test failure, zero or more times per test case at any point between test case start and finish
testCaseDidFinish(_:) — exactly once per test case
testSuite(_:didRecord:) — for each test failure, zero or more times per test suite at any point between test suite start and finish
testSuite(_:didRecord:) — for each expected test failure, zero or more times per test suite at any point between test suite start and finish
testSuiteDidFinish(_:) — exactly once per test suite
testBundleDidFinish(_:) — exactly once per test bundle
See XCTestObservationCenter for details about registering and removing test observers.
Topics
Observation Methods
testBundleWillStart(_:)testSuiteWillStart(_:)testCaseWillStart(_:)testCase(_:didRecord:)testCase(_:didRecord:)testCase(_:didFailWithDescription:inFile:atLine:)testCaseDidFinish(_:)testSuite(_:didRecord:)testSuite(_:didRecord:)testSuite(_:didFailWithDescription:inFile:atLine:)testSuiteDidFinish(_:)testBundleDidFinish(_:)