---
title: Traits
framework: testing
role: collectionGroup
role_heading: API Collection
path: testing/traits
---

# Traits

Annotate test functions and suites, and customize their behavior.

## Overview

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 tests](testing/enablinganddisabling.md)
- [Limiting the running time of tests](testing/limitingexecutiontime.md)
- [enabled(if:_:sourceLocation:)](testing/trait/enabled(if:_:sourcelocation:).md)
- [enabled(_:sourceLocation:_:)](testing/trait/enabled(_:sourcelocation:_:).md)
- [disabled(_:sourceLocation:)](testing/trait/disabled(_:sourcelocation:).md)
- [disabled(if:_:sourceLocation:)](testing/trait/disabled(if:_:sourcelocation:).md)
- [disabled(_:sourceLocation:_:)](testing/trait/disabled(_:sourcelocation:_:).md)
- [timeLimit(_:)](testing/trait/timelimit(_:).md)

### Running tests serially or in parallel

- [Running tests serially or in parallel](testing/parallelization.md)
- [serialized](testing/trait/serialized.md)

### Annotating tests

- [Adding tags to tests](testing/addingtags.md)
- [Adding comments to tests](testing/addingcomments.md)
- [Associating bugs with tests](testing/associatingbugs.md)
- [Interpreting bug identifiers](testing/bugidentifiers.md)
- [Tag()](testing/tag().md)
- [bug(_:_:)](testing/trait/bug(_:_:).md)
- [bug(_:id:_:)](testing/trait/bug(_:id:_:)-10yf5.md)
- [bug(_:id:_:)](testing/trait/bug(_:id:_:)-3vtpl.md)

### Handling issues

- [compactMapIssues(_:)](testing/trait/compactmapissues(_:).md)
- [filterIssues(_:)](testing/trait/filterissues(_:).md)

### Creating custom traits

- [Trait](testing/trait.md)
- [TestTrait](testing/testtrait.md)
- [SuiteTrait](testing/suitetrait.md)
- [TestScoping](testing/testscoping.md)

### Supporting types

- [Bug](testing/bug.md)
- [Comment](testing/comment.md)
- [ConditionTrait](testing/conditiontrait.md)
- [IssueHandlingTrait](testing/issuehandlingtrait.md)
- [ParallelizationTrait](testing/parallelizationtrait.md)
- [Tag](testing/tag.md)
- [Tag.List](testing/tag/list.md)
- [TimeLimitTrait](testing/timelimittrait.md)
