swift-testing

Write, migrate, and diagnose Swift Testing suites under xcodebuild.

3|Updated Nov 8, 2014
One-click install
npx skills add https://github.com/mintuz/.dotfiles --skill swift-testing-mintuz
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: swift-testing
Source: https://github.com/mintuz/.dotfiles/tree/main/agents/.agents/skills/swift-testing
Command: npx skills add https://github.com/mintuz/.dotfiles --skill swift-testing-mintuz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Swift Testing uses macros and result reporting that differ sharply from XCTest, so developers migrating test suites or reading xcodebuild output often misjudge whether tests actually ran, passed, or crashed. ## Core Features & Use Cases - Macro-driven test authoring: Write tests with @Test, #expect, #require, and Issue.record, including async, throwing, and parameterized cases. - Staged XCTest migration: Convert XCTest targets to Swift Testing incrementally while keeping the target green, since both frameworks run side by side. - Result bundle diagnosis: Read fresh xcresult bundles with xcresulttool to detect zero-test runs, crashes, and environmental faults that console output hides. - Use Case: A run reports "Executed 0 tests" after renaming a suite; use this Skill to verify the -only-testing selection, inspect the result bundle, and confirm the real test count. ## Quick Start Help me migrate my XCTest target to Swift Testing and verify the results from the xcodebuild result bundle.

Frequently Asked Questions about swift-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate XCTest tests to Swift Testing?▼

Migrate XCTest to Swift Testing in stages, converting one class or small batch per stage while keeping the target green. Both frameworks run side by side in the same target, so a partially migrated project is a supported end state.

How do I write parameterized tests in Swift Testing?▼

Use @Test(arguments:) with immutable, Sendable case values in one test function. Give custom case types a CustomTestStringConvertible description so failures identify the case clearly, and create mutable fixtures inside each invocation.

Can Swift Testing replace XCUITest and performance tests?▼

No. Swift Testing covers unit and integration tests but provides no UI-automation or performance-measurement API. Keep XCUITest tests and XCTest measure-based performance tests on XCTest.

Why does xcodebuild report zero tests for Swift Testing?▼

Swift Testing does not emit XCTest's per-test console lines, so "Executed 0 tests" is just the empty XCTest summary. Check the fresh result bundle with xcresulttool and confirm -only-testing still names the current suite after any rename.

What is the difference between #expect and #require in Swift Testing?▼

#expect records a failure and continues the test, while #require throws immediately when the condition is false, halting the test. Use #require to unwrap optionals before further assertions depend on the value.