Crate objc2_xc_test

Crate objc2_xc_test 

Source
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/Frameworks

See the example of using XCTest for more information.

Structs§

XCTApplicationLaunchMetric
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.
XCTAttachmentLifetime
Apple’s documentation
XCTCPUMetric
A metric which measures instructions retired and time utilization of the CPU.
XCTClockMetric
A metric which gathers monotonic time data.
XCTContext
Apple’s documentation
XCTDarwinNotificationExpectation
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 expectedFulfillmentCount property with this class.
XCTExpectedFailure
Contains the details about a single instance of an expected failure, including the failure reason and the underlying issue that was recorded.
XCTExpectedFailureOptions
Describes the rules for matching issues to expected failures and other behaviors related to expected failure handling.
XCTHitchMetric
A metric which measures the hitches encountered.
XCTImageQuality
Apple’s documentation
XCTIssue
Encapsulates all data concerning a test failure or other issue.
XCTIssueSeverity
An enum representing the severity of a test issue.
XCTIssueType
Types of failures and other issues that can be reported for tests.
XCTKVOExpectation
Expectation subclass for waiting on a condition defined Key Value Observation of a key path for an object.
XCTMeasureOptions
Collection of options which configures behavior when passed into the -[XCTMeasure measure*] APIs.
XCTMeasurementInvocationOptions
Apple’s documentation
XCTMemoryMetric
A metric which measures utilization of physical memory.
XCTMutableIssue
Mutable variant of XCTIssue, suitable for modifying by overrides in the reporting chain.
XCTNSNotificationExpectation
Expectation subclass for waiting on a condition defined by an NSNotification.
XCTNSPredicateExpectation
Expectation subclass for waiting on a condition defined by an NSPredicate and an object.
XCTOSSignpostMetric
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:
XCTPerformanceMeasurement
Contains the data acquired from a single metric being measured for an individual iteration.
XCTPerformanceMeasurementPolarity
Apple’s documentation
XCTPerformanceMeasurementTimestamp
Encapsulates timestamps at various levels
XCTSourceCodeContext
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.
XCTSourceCodeFrame
Represents a single frame in a call stack and supports retrieval of symbol information for the address.
XCTSourceCodeLocation
Contains a file URL and line number representing a distinct location in source code related to a run of a test.
XCTSourceCodeSymbolInfo
Contains symbolication information for a given frame in a call stack.
XCTStorageMetric
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.
XCTWaiterResult
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.
XCTestCase
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.
XCTestCaseRun
Apple’s documentation
XCTestErrorCode
Error codes used with errors in the XCTestErrorDomain.
XCTestExpectation
Expectations represent specific conditions in asynchronous testing.
XCTestLogDeprecated
Apple’s documentation
XCTestObservationCenter
The XCTestObservationCenter distributes information about the progress of test runs to registered observers. Observers can be any object conforming to the XCTestObservation protocol.
XCTestObserverDeprecated
XCTestObserver is deprecated.
XCTestProbeDeprecated
Apple’s documentation
XCTestRun
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”.
XCTestSuite
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:
XCTestSuiteRun
Apple’s documentation
_XCTAssertionType
Apple’s documentation
_XCTSkipFailureException
Apple’s documentation
_XCTestCaseInterruptionException
Apple’s documentation

Statics§

XCTPerformanceMetric_WallClockTime
Records wall clock time in seconds between startMeasuring/stopMeasuring.
XCTestErrorDomain
Domain for errors provided by the XCTest framework.
XCTestObserverClassKeyDeprecated
XCTestObserverClassKey is deprecated and ignored.
XCTestScopeAllDeprecated
Apple’s documentation
XCTestScopeKeyDeprecated
Apple’s documentation
XCTestScopeNoneDeprecated
Apple’s documentation
XCTestScopeSelfDeprecated
Apple’s documentation
XCTestToolKeyDeprecated
Apple’s documentation
XCTestedUnitPathDeprecated
Apple’s documentation

Traits§

XCTActivity
Represents a test activity.
XCTMetric
Defines a protocol which may be used with the -measureWithMetrics* methods on XCTestCase.
XCTWaiterDelegate
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.
XCTestObservation
Objects conforming to XCTestObservation can register to be notified of the progress of test runs. See XCTestObservationCenter for details on registration.

Functions§

XCTExpectFailure
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.
XCTExpectFailureInBlockblock2
Like XCTExpectFailure, but limits the scope in which issues are matched.
XCTExpectFailureWithOptions
Like XCTExpectFailure, but takes an options object that can be used to customize the behavior.
XCTExpectFailureWithOptionsInBlockblock2
Like XCTExpectFailure, but takes an options object that can be used to customize the behavior and limits the scope in which issues are matched.
XCTSelfTestMainDeprecated

Type Aliases§

XCKeyValueObservingExpectationHandlerblock2
A block to be invoked when a change is observed for the keyPath of the observed object.
XCNotificationExpectationHandlerblock2
A block to be invoked when a notification matching the specified name is observed from the object.
XCPredicateExpectationHandlerblock2
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.
XCTDarwinNotificationExpectationHandlerblock2
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.
XCTPerformanceMetric
Apple’s documentation
XCWaitCompletionHandlerblock2
A block to be invoked when a call to -waitForExpectationsWithTimeout:handler: times out or has had all associated expectations fulfilled.