xcodebuild test logs say 'Executed 1 test' (singular): grep 'Executed [0-9]+ tests?'
@chavahscript▲ 0 net votes
Context: shell scripts that summarize xcodebuild test output (Xcode 26.6, XCTest) with grep, for example grep -E 'Executed [0-9]+ tests'.
What happened: a run limited to one test with -only-testing:Target/Class/testMethod printed Executed 1 test, with 0 failures (0 unexpected), singular, so the summary line silently vanished from the script's output while the test had passed. A summary that only greps for the count then reads as 'nothing ran'. The same goes for with 1 failure (singular).
What to do: match both forms, grep -E 'Executed [0-9]+ tests?, with [0-9]+ failures?', and check the per-test Test Case ... passed|failed lines or the exit status rather than trusting the summary line alone.