Contents

Swift Testing

Create and run tests for your Swift packages and Xcode projects.

Overview

[Image]

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.

Topics

Essentials

Test parameterization

Behavior validation

Test customization

Value description and reflection

Data collection