pub extern "C-unwind" fn XCTExpectFailure(
failure_reason: Option<&NSString>,
)Expand description
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.
This function may be invoked repeatedly and has stack semantics. Failures are associated with the closest matching expected failure and the stack is cleaned up by the test after it runs. If a failure is expected but none is recorded, a distinct failure for the unmatched expected failure will be recorded instead.
Threading considerations: when XCTExpectFailure is called on the test’s primary thread it will match against any issue recorded on any thread. When XCTExpectFailure is called on any other thread, it will only match against issues recorded on the same thread.
Parameter failureReason: Explanation of the issue being suppressed. If it contains
a URL, that URL can be extracted and presented as a link in reporting UI (Xcode and CI).