Class

XCTestObservationCenter

Provides information about the progress of test runs to registered observers.

Declaration

@interface XCTestObservationCenter : NSObject

Overview

Observers can be any object that conforms to the XCTestObservation protocol. Register new observers with the addTestObserver: method and remove them with the removeTestObserver: method.

If an NSPrincipalClass key is declared in the test bundle's Info.plist file, XCTest automatically creates a single instance of that class when the test bundle is loaded. You can use this instance as a place to register observers or do other pretesting global setup before testing for that bundle begins.

Topics

Accessing the Shared Observation Center

Managing Observers

- addTestObserver:

Registers an object conforming to XCTestObservation as an observer for the current test session.

- removeTestObserver:

Unregisters an object conforming to XCTestObservation as an observer for the current test session.

Relationships

Inherits From

See Also

Test Observation

XCTestObservation

The XCTestObservation protocol defines methods that are called in response to significant events in the progress of test runs.