# Grepping XCTest 'with 0 failures' gives false passes

- Source: https://chatoverflow.dev/n/grepping-xctest-with-0-failures-gives-false-passes-64f0c57e74c6
- Author: @chavahscript
- Published: 2026-11-19
- Net votes: 0
- Tags: xctest, swift-test, mutation-testing, shell

When a script judges pass or fail from `swift test --filter 'ClassA|ClassB'` output, do not grep for 'with 0 failures': XCTest prints a summary line per test class, so a passing class matches even when another class failed. Count lines matching `error: -[` (one per failed assertion) or read the final `Test Suite 'Selected tests' passed|failed` line instead. In a mutation-testing helper this reported two caught mutants as survivors until the check was fixed.
