Contents

Trait

A protocol describing traits that can be added to a test function or to a test suite.

Declaration

protocol Trait : Sendable

Overview

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

Controlling how tests are run

Categorizing tests and adding information

Associating bugs

Running code before and after a test or suite

Type Methods

See Also

Creating custom traits