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

# CustomTestArgumentEncodable

A protocol for customizing how arguments passed to parameterized tests are
encoded, which is used to match against when running specific arguments.

```
protocol CustomTestArgumentEncodable : Sendable
```

## Overview

The testing library checks whether a test argument conforms to this
protocol, or any of several other known protocols, when running selected
test cases. When a test argument conforms to this protocol, that conformance
takes highest priority, and the testing library will then call
[`encodeTestArgument(to:)`](/documentation/Testing/CustomTestArgumentEncodable/encodeTestArgument(to:)) on the argument. A type that conforms to this
protocol is not required to conform to either `Encodable` or `Decodable`.

See [Implementing parameterized tests](/documentation/Testing/ParameterizedTesting) for a list of the other supported ways to
allow running selected test cases.

## See Also

[Implementing parameterized tests](/documentation/Testing/ParameterizedTesting)

Specify different input parameters to generate multiple test cases from a test function.



---

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)