Create and run tests for your Swift packages and Xcode projects.
With Swift Testing you leverage powerful and expressive capabilities of the Swift programming language to develop tests with more confidence and less code. The library integrates seamlessly with Swift Package Manager testing workflow, supports flexible test organization, customizable metadata, and scalable test execution.
- Define test functions almost anywhere with a single attribute.
- Group related tests into hierarchies using Swift's type system.
- Integrate seamlessly with Swift concurrency.
- Parameterize test functions across wide ranges of inputs.
- Enable tests dynamically depending on runtime conditions.
- Parallelize tests in-process.
- Categorize tests using tags.
- Associate bugs directly with the tests that verify their fixes or reproduce their problems.
@Links(visualStyle: compactGrid) {
- doc://com.apple.documentation/videos/play/wwdc2024/10179
- doc://com.apple.documentation/videos/play/wwdc2024/10195 }
- doc:DefiningTests
- doc:OrganizingTests
- doc:MigratingFromXCTest
Test(_:_:)
Test
Suite(_:_:)
- doc:ParameterizedTesting
Test(_:_:arguments:)-8kn7a
Test(_:_:arguments:_:)
Test(_:_:arguments:)-3rzok
CustomTestArgumentEncodable
Test/Case
- doc:Expectations
- doc:known-issues
- doc:Traits
- doc:Attachments