Trait
A protocol describing traits that can be added to a test function or to a test suite.
Declaration
protocol Trait : SendableOverview
The testing library defines a number of traits that can be added to test functions and to test suites. Define your own traits by creating types that conform to TestTrait or SuiteTrait:
- TestTrait
Conform to this type in traits that you add to test functions.
- SuiteTrait
Conform to this type in traits that you add to test suites.
You can add a trait that conforms to both TestTrait and SuiteTrait to test functions and test suites.
Topics
Enabling and disabling tests
enabled(if:_:sourceLocation:)enabled(_:sourceLocation:_:)disabled(_:sourceLocation:)disabled(if:_:sourceLocation:)disabled(_:sourceLocation:_:)