Expand description
§Bindings to the XCTest framework
See Apple’s docs and the general docs on framework crates for more information.
WARNING: You cannot normally link to this framework unless you add something like the following:
RUSTFLAGS="-Clink-args=-F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks"And add the following when running the binary:
DYLD_FRAMEWORK_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/FrameworksSee the example of using XCTest for more information.
Structs§
- XCTApplication
Launch Metric - A metric which measures application launch durations.
- XCTAttachment
- Represents the concept of data attached to an XCTActivity. Allows reporting more context about the test run for debugging, such as screenshots, log files, and configuration dictionaries.
- XCTAttachment
Lifetime - Apple’s documentation
- XCTCPU
Metric - A metric which measures instructions retired and time utilization of the CPU.
- XCTClock
Metric - A metric which gathers monotonic time data.
- XCTContext
- Apple’s documentation
- XCTDarwin
Notification Expectation - Expectation subclass for waiting on a condition defined by a Darwin notification. The notification
which may be posted in the same process or by other processes. Be aware that Darwin notifications
may be coalesced when posted in quick succession, so be careful especially when using the
expectedFulfillmentCountproperty with this class. - XCTExpected
Failure - Contains the details about a single instance of an expected failure, including the failure reason and the underlying issue that was recorded.
- XCTExpected
Failure Options - Describes the rules for matching issues to expected failures and other behaviors related to expected failure handling.
- XCTHitch
Metric - A metric which measures the hitches encountered.
- XCTImage
Quality - Apple’s documentation
- XCTIssue
- Encapsulates all data concerning a test failure or other issue.
- XCTIssue
Severity - An enum representing the severity of a test issue.
- XCTIssue
Type - Types of failures and other issues that can be reported for tests.
- XCTKVO
Expectation - Expectation subclass for waiting on a condition defined Key Value Observation of a key path for an object.
- XCTMeasure
Options - Collection of options which configures behavior when passed into the -[XCTMeasure measure*] APIs.
- XCTMeasurement
Invocation Options - Apple’s documentation
- XCTMemory
Metric - A metric which measures utilization of physical memory.
- XCTMutable
Issue - Mutable variant of XCTIssue, suitable for modifying by overrides in the reporting chain.
- XCTNS
Notification Expectation - Expectation subclass for waiting on a condition defined by an NSNotification.
- XCTNS
Predicate Expectation - Expectation subclass for waiting on a condition defined by an NSPredicate and an object.
- XCTOS
Signpost Metric - A metric which measures timestamp data gathered from os_signposts. If the interval being measured is an animation os_signpost interval then the following data will also be gathered:
- XCTPerformance
Measurement - Contains the data acquired from a single metric being measured for an individual iteration.
- XCTPerformance
Measurement Polarity - Apple’s documentation
- XCTPerformance
Measurement Timestamp - Encapsulates timestamps at various levels
- XCTSource
Code Context - Call stack and optional specific location - which may or may not be also included in the call stack providing context around a point of execution in a test.
- XCTSource
Code Frame - Represents a single frame in a call stack and supports retrieval of symbol information for the address.
- XCTSource
Code Location - Contains a file URL and line number representing a distinct location in source code related to a run of a test.
- XCTSource
Code Symbol Info - Contains symbolication information for a given frame in a call stack.
- XCTStorage
Metric - A metric which measures utilization of the file storage media.
- XCTWaiter
- Manages waiting - pausing the current execution context - for an array of XCTestExpectations. Waiters can be used with or without a delegate to respond to events such as completion, timeout, or invalid expectation fulfillment. XCTestCase conforms to the delegate protocol and will automatically report timeouts and other unexpected events as test failures.
- XCTWaiter
Result - Values returned by a waiter when it completes, times out, or is interrupted due to another waiter higher in the call stack timing out.
- XCTest
- An abstract base class for testing. XCTestCase and XCTestSuite extend XCTest to provide for creating, managing, and executing tests. Most developers will not need to subclass XCTest directly.
- XCTest
Case - XCTestCase is a concrete subclass of XCTest that should be the override point for most developers creating tests for their projects. A test case subclass can have multiple test methods and supports setup and tear down that executes for every test method as well as class level setup and tear down.
- XCTest
Case Run - Apple’s documentation
- XCTest
Error Code - Error codes used with errors in the XCTestErrorDomain.
- XCTest
Expectation - Expectations represent specific conditions in asynchronous testing.
- XCTest
Log Deprecated - Apple’s documentation
- XCTest
Observation Center - The XCTestObservationCenter distributes information about the progress of test runs to registered observers. Observers can be any object conforming to the XCTestObservation protocol.
- XCTest
Observer Deprecated - XCTestObserver is deprecated.
- XCTest
Probe Deprecated - Apple’s documentation
- XCTest
Run - 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”.
- XCTest
Suite - A concrete subclass of XCTest, XCTestSuite is a collection of test cases. Suites are usually managed by the IDE, but XCTestSuite also provides API for dynamic test and suite management:
- XCTest
Suite Run - Apple’s documentation
- _XCT
Assertion Type - Apple’s documentation
- _XCT
Skip Failure Exception - Apple’s documentation
- _XCTest
Case Interruption Exception - Apple’s documentation
Statics§
- XCTPerformance
Metric_ ⚠Wall Clock Time - Records wall clock time in seconds between startMeasuring/stopMeasuring.
- XCTest
Error ⚠Domain - Domain for errors provided by the XCTest framework.
- XCTest
Observer ⚠Class Key Deprecated - XCTestObserverClassKey is deprecated and ignored.
- XCTest
Scope ⚠All Deprecated - Apple’s documentation
- XCTest
Scope ⚠Key Deprecated - Apple’s documentation
- XCTest
Scope ⚠None Deprecated - Apple’s documentation
- XCTest
Scope ⚠Self Deprecated - Apple’s documentation
- XCTest
Tool ⚠Key Deprecated - Apple’s documentation
- XCTested
Unit ⚠Path Deprecated - Apple’s documentation
Traits§
- XCTActivity
- Represents a test activity.
- XCTMetric
- Defines a protocol which may be used with the -measureWithMetrics* methods on XCTestCase.
- XCTWaiter
Delegate - Events are reported to the waiter’s delegate via these methods. XCTestCase conforms to the delegate protocol and will automatically report timeouts and other unexpected events as test failures.
- XCTest
Observation - Objects conforming to XCTestObservation can register to be notified of the progress of test runs. See XCTestObservationCenter for details on registration.
Functions§
- XCTExpect
Failure - Declares that the test is expected to fail at some point beyond the call. This can be used to both document and suppress a known issue when immediate resolution is not possible. Issues caught by XCTExpectFailure do not impact the aggregate results of the test suites which own them.
- XCTExpect
Failure InBlock block2 - Like XCTExpectFailure, but limits the scope in which issues are matched.
- XCTExpect
Failure With Options - Like XCTExpectFailure, but takes an options object that can be used to customize the behavior.
- XCTExpect
Failure With Options InBlock block2 - Like XCTExpectFailure, but takes an options object that can be used to customize the behavior and limits the scope in which issues are matched.
- XCTSelf
Test Main Deprecated
Type Aliases§
- XCKey
Value Observing Expectation Handler block2 - A block to be invoked when a change is observed for the keyPath of the observed object.
- XCNotification
Expectation Handler block2 - A block to be invoked when a notification matching the specified name is observed from the object.
- XCPredicate
Expectation Handler block2 - Handler called when evaluating the predicate against the object returns true. If the handler is not provided the first successful evaluation will fulfill the expectation. If provided, the handler will be queried each time the notification is received to determine whether the expectation should be fulfilled or not.
- XCTDarwin
Notification Expectation Handler block2 - Handler called when the expectation has received the Darwin notification. If the handler is not provided the first posting of the notification will fulfill the expectation. If provided, the handler will be queried each time the notification is received to determine whether the expectation should be fulfilled or not. This allows the caller to check Darwin state variables or perform other logic beyond simply verifying that the notification has been posted.
- XCTPerformance
Metric - Apple’s documentation
- XCWait
Completion Handler block2 - A block to be invoked when a call to -waitForExpectationsWithTimeout:handler: times out or has had all associated expectations fulfilled.