CheckOps home

Tools directory

S

CheckOps

Swift Testing

Swift Testing is Apple's open-source (Apache-2.0) testing library for Swift, using @Test and #expect macros, parameterised tests, traits and parallel execution, included in Xcode 16 and Swift 6 toolchains.

Visit website

Latest public signals

Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.

Visit Website

Introduction

Swift Testing is a modern testing library for Swift, developed in the open by the Swift project. It is included with Swift 6 toolchains and Xcode 16 and later, and runs on Apple platforms, Linux and Windows. It uses Swift macros to make tests concise and expressive, and is designed to coexist with XCTest in the same target, so teams can migrate gradually.

Tests are functions marked @Test, optionally grouped in types marked @Suite. The #expect macro captures the full expression, so failures show the values of each sub-expression, and #require stops a test when a precondition fails (also unwrapping optionals). Parameterised tests pass arguments: to run one function over many inputs, each reported separately. Traits customise behaviour: tags for organisation, .disabled, .enabled(if:), .bug(...), time limits and serialised execution. Tests run in parallel by default, including across async code with Swift concurrency. The repository’s most recent release tag was swift-6.4.2-RELEASE on 30 October 2026.

The source code is at swiftlang/swift-testing on GitHub under the Apache-2.0 licence, with about 2,200 stars; the most recent commit was on 11 November 2026.

Features

  1. Macro-based assertions: #expect and #require with rich failure output.
  2. Parameterised tests: arguments: for data-driven tests.
  3. Traits and tags: Conditions, time limits, bug links and tags.
  4. Parallel by default: Built on Swift concurrency.

Pros

  1. Free to use: Open source under the Apache-2.0 licence, so the core tool costs nothing to use.
  2. Actively maintained: The repository had commits as recent as 11 November 2026.

Cons

  1. No UI testing: Use XCTest/XCUITest for UI automation.
  2. Newer ecosystem: Some tools and libraries still assume XCTest.
import Testing
@testable import Shop

@Suite struct PricingTests {
    @Test func appliesDiscount() {
        #expect(Pricing.apply(100, percent: 10) == 90)
    }

    @Test("Discounts never exceed price", arguments: [0, 10, 50, 100])
    func neverExceedsPrice(percent: Int) {
        #expect(Pricing.apply(100, percent: percent) <= 100)
    }

    @Test func parsesOrder() throws {
        let order = try #require(Order(json: sampleJSON))
        #expect(order.items.count == 2)
    }
}
swift test

Resources:

Pricing

Swift Testing is free and open source under the Apache-2.0 licence.

  1. Swift developers on Xcode 16+ or Swift 6 starting new test suites.
  2. Server-side and cross-platform Swift projects on Linux or Windows.

Conclusion

Swift Testing is the future of unit testing in Swift, expressive, parallel and cross-platform, while XCTest remains for UI tests.

Alternatives

Other tools on CheckOps that cover similar ground. Open a page, or compare one with Swift Testing side by side.