Traits
Annotate test functions and suites, and customize their behavior.
Overview
Pass built-in traits to test functions or suite types to comment, categorize, classify, and modify the runtime behavior of test suites and test functions. Implement the TestTrait, and SuiteTrait protocols to create your own types that customize the behavior of your tests.
Topics
Customizing runtime behaviors
Enabling and disabling testsLimiting the running time of testsenabled(if:_:sourceLocation:)enabled(_:sourceLocation:_:)disabled(_:sourceLocation:)disabled(if:_:sourceLocation:)disabled(_:sourceLocation:_:)timeLimit(_:)
Running tests serially or in parallel
Annotating tests
Adding tags to testsAdding comments to testsAssociating bugs with testsInterpreting bug identifiersTag()bug(_:_:)bug(_:id:_:)bug(_:id:_:)