<!--
{
  "availability" : [
    "Xcode: 16.0.0 -",
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "swift: 6.0.0 -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Testing",
  "identifier" : "/documentation/Testing/Suite(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Macro",
  "symbol" : {
    "kind" : "Macro",
    "modules" : [
      "Swift Testing"
    ],
    "preciseIdentifier" : "s:7Testing5SuiteyySSSgYt_AA0B5Trait_pdtcfm"
  },
  "title" : "Suite(_:_:)"
}
-->

# Suite(_:_:)

Declare a test suite.

```
@attached(peer) macro Suite(_ displayName: String? = nil, _ traits: any SuiteTrait...)
```

## Parameters

`displayName`

The customized display name of this test suite. If the
value of this argument is `nil`, the display name of the test is derived
from the associated type’s name.

`traits`

Zero or more traits to apply to this test suite.

## Overview

A test suite is a type that contains one or more test functions. Any type
may be a test suite.

The use of the `@Suite` attribute is optional; types are recognized as test
suites even if they do not have the `@Suite` attribute applied to them.

When adding test functions to a type extension, do not use the `@Suite`
attribute. Only a type’s primary declaration may have the `@Suite` attribute
applied to it.

## See Also

[Organizing test functions with suite types](/documentation/Testing/OrganizingTests)

Organize tests into test suites.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)