Skip to content

Latest commit

 

History

History
75 lines (54 loc) · 1.96 KB

Documentation.md

File metadata and controls

75 lines (54 loc) · 1.96 KB

Testing

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

Overview

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.

Related videos

@Links(visualStyle: compactGrid) {

  • doc://com.apple.documentation/videos/play/wwdc2024/10179
  • doc://com.apple.documentation/videos/play/wwdc2024/10195 }

Topics

Essentials

  • doc:DefiningTests
  • doc:OrganizingTests
  • doc:MigratingFromXCTest
  • Test(_:_:)
  • Test
  • Suite(_:_:)

Test parameterization

  • doc:ParameterizedTesting
  • Test(_:_:arguments:)-8kn7a
  • Test(_:_:arguments:_:)
  • Test(_:_:arguments:)-3rzok
  • CustomTestArgumentEncodable
  • Test/Case

Behavior validation

  • doc:Expectations
  • doc:known-issues

Test customization

  • doc:Traits

Data collection

  • doc:Attachments