Swift Test
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
Run a Swift project’s test suite through whichever runner its layout calls for — SwiftPM’s swift test for a
package, xcodebuild test for an Xcode app/workspace project — scoped to whatever the caller asked for, and
report a compact pass/fail summary. This is a read-only reporting skill: it runs tests and summarizes the
outcome, it does not fix failures or modify source/test code unless asked to as an explicit follow-up.
Purpose
iru-swift-test turns a loosely-specified request ("run FooTests", "just testBar", "everything") into the
correct swift test --filter/--skip or xcodebuild -only-testing:/-skip-testing: invocation, detects
package vs. app from the repository layout, parses whichever result format that runner produces (console output
for swift test, an .xcresult bundle via xcresulttool for xcodebuild test), and — critically — detects the
"selector matched zero tests" case that both runners otherwise hide behind a passing, exit-0 result. It is the
Swift/Apple-platforms equivalent of iru-java-test/iru-typescript-test/iru-android-test.
Its Known quirks now record that a macOS desktop app scaffolded by iru-setup-macos-app (Automatic signing, empty
DEVELOPMENT_TEAM) tests with a plain xcodebuild test -destination 'platform=macOS' — Xcode signs with "Sign to
Run Locally", so no signing overrides are added (verified on Xcode 27.1 for both the SwiftUI/MVVM and AppKit/MVC
scaffolds); only a project naming a real team whose certificate is missing needs ad-hoc overrides (unverified).
For an iru-setup-apple-app multiplatform project it understands the per-platform schemes (<AppName>-iOS,
-macOS, -watchOS, -visionOS, each running CoreTests plus that platform’s unit and UI test targets, with
XcodeGen’s Core package scheme ignored): a selector under Targets/<Platform>/ runs only that platform’s scheme, a
Packages/Core-only selector runs the first platform scheme (iOS, macOS, watchOS, visionOS order), and the whole
suite runs every platform scheme, reported per scheme. Simulator destinations are resolved to the newest installed
runtime the selected Xcode supports and always pinned with OS=, because device names repeat across runtimes and
xcodebuild otherwise silently picks one.
A leading ui word in the selector asks for a UI run under the catalog’s UI contract (see Building user interfaces): the component-capture and XCUITest screen/flow tests, their screenshots under .ui-screenshots/ and their accessibility audits, reading the level from .ui-quality.yml. A platform with no installed runtime — typically visionOS — is
compile-checked against generic/platform=visionOS Simulator and reported "unverified (no visionOS simulator runtime
installed)", never as passed and never downloaded (verified on Xcode 27.1 for the iOS, UIKit iOS, watchOS and
visionOS scaffold schemes).
When .ui-quality.yml says accessibility: none (opted out entirely) or off (rules apply, checks not run), accessibility checks are not applicable: they are skipped and reported as "accessibility: opted out" (none) or "accessibility checks off" (off) — never "unverified" and never a failure.
Plugin
Shipped by the iru-swift plugin of the ai-catalog marketplace (install with /plugin install iru-swift@ai-catalog; see Plugins).
Inputs
| Argument | Required | Description | Default |
|---|---|---|---|
|
No |
A positional argument naming what to run: a bare test/method name, a suite/class name, a |
None — omitting it runs the full suite. |
|
No |
|
Auto-detected from the repository’s files. |
|
No |
|
Auto-detected via |
|
No |
|
Inferred from the scheme suffix or the project: |
|
No |
|
None — |
|
No |
A leading |
Not a UI run |
|
No |
|
The skill takes the lock itself for an app UI run |
These key: value overrides are only honored when the calling skill/prompt passes them explicitly; otherwise
this skill infers everything itself in Steps 1–3.
Package selector mapping (swift test):
| What the user wants | Flag | Example |
|---|---|---|
Everything |
(omit |
|
One test/method name |
|
|
One suite/class |
|
|
One method in one suite |
|
|
One target/module |
|
|
Several disjoint names |
repeat |
|
Excluding a pattern |
|
|
App selector mapping (xcodebuild test):
| What the user wants | Flag | Example |
|---|---|---|
Everything |
(omit |
|
One suite/class |
|
|
One method in one suite |
|
|
Whole test target/bundle |
|
|
Several disjoint scopes |
repeat |
|
Excluding a scope |
|
|
Outputs
-
A plain-text summary in the conversation — never a written file.
-
Package path: totals parsed from the console’s
Executed <N> tests, with <F> failures…/Test run with <N> tests…lines (XCTest and Swift Testing both run in oneswift testinvocation). -
App path: totals from
xcresulttool get test-results summary(passedTests/failedTests/totalTestCount/result). -
With several per-platform schemes, results reported per scheme; a scheme without a simulator runtime (typically visionOS) listed as "unverified (no visionOS simulator runtime installed)" with its
build-for-testingresult. -
On failures: each failing test’s name plus the first line of its assertion/expectation message — for the app path, also the
.xcresultbundle path for full detail instead of dumping it. -
"Selector matched no tests" reported explicitly and distinctly from a clean pass, for the zero-match case both runners otherwise hide behind exit code 0.
-
UI run:
.ui-screenshots/<kind>/<Id>/<state>--<direction>--<theme>[--<variant>].png(viaUI_SCREENSHOTS_DIR, with captures recovered from the.xcresultthroughxcresulttool export attachmentswhen the test process couldn’t write them), and a summary with the screenshot count percomponent/screen/flow, malformed names, accessibility issues (count and rule ids, and whether they failed the run) at the.ui-quality.ymllevel, whether the directory was cleared or kept, and every scheme reported unverified (no simulator runtime, no desktop session or permission) with its reason. -
No source or test code is ever modified.
Execution flow
Dependencies
Invokes
None — iru-swift-test is a leaf skill; it only runs swift test/xcodebuild test commands and reports on
their output, it does not call any other skill in this catalog.
Invoked by
-
Swift Code One Task Group — Step 3.4 (and the
uirun of Step 3.7, withlock: held), once per group validation pass, via theiru-gate-runneragent, alongsideiru-check-license(3.1),iru-swift-docc(3.2), andiru-swift-coverage(3.5). -
Swift Generate All Tests — Step 5b (full
uirun) and Step 7, via theiru-gate-runneragent, to run the newly generated tests afteriru-swift-coveragemeasures the baseline.
Related agents
-
iru-gate-runner— bothiru-swift-code-one-task-groupandiru-swift-generate-all-testsalways invoke this skill from inside airu-gate-runnersub-agent they spawn, not inline.
Source
SKILL.md on GitHub — the file this page was generated from.