tests: every suite returns 1 for a failure, not the count

Six suites ended in `return Failures;`. `crafter-build test` takes an
exit status of 77 for a skipped suite and then succeeds, and an exit
status keeps 8 bits: 77 failing checks read as a skip, 256 as a pass.
All nine now return 1 after any failure, as Engine, Sip and Sms did.

Tested with 77 failing checks added to Ipsec, to Messages and to Sdp
in turn (the fp6 journal's 2026-11-20-issues-2-5 capture, exit-status):
before, `crafter-build test` ended `8 passed, 1 skipped` with exit
status 0; now it ends `8 passed, 1 failed` with exit status 1.
This commit is contained in:
Jorijn van der Graaf 2026-11-22 17:35:11 +01:00
commit a63132deb8
Signed by: jorijnvdgraaf
GPG key ID: 2937E59CDCC1BCFB
7 changed files with 7 additions and 8 deletions

View file

@ -242,8 +242,7 @@ releases. This is the flow CI runs (§9.4).
`crafter-build test` runs the nine suites. Each suite `crafter-build test` runs the nine suites. Each suite
is a plain `main()` with a `Check(bool, message)` counter: failures print is a plain `main()` with a `Check(bool, message)` counter: failures print
`FAIL: …`, success prints `<Suite>: all tests passed`, and the exit status is `FAIL: …`, success prints `<Suite>: all tests passed`, and the exit status is
the failure count for six suites — non-zero short of a multiple of 256 — and 1 after any failure. `crafter-build test` ending in `9 passed`, on every
1 for `Engine`, `Sip` and `Sms`. `crafter-build test` ending in `9 passed`, on every
commit of a range (§11), is the project's definition of green. commit of a range (§11), is the project's definition of green.
What the suites pin: What the suites pin:

View file

@ -145,5 +145,5 @@ int main() {
} }
if (Failures == 0) std::println("Aka: all tests passed"); if (Failures == 0) std::println("Aka: all tests passed");
return Failures; return Failures != 0; // not the count: `crafter-build test` takes an exit status of 77 for a skipped suite, and an exit status keeps 8 bits
} }

View file

@ -374,5 +374,5 @@ int main() {
} }
if (Failures == 0) std::println("Ipsec: all tests passed"); if (Failures == 0) std::println("Ipsec: all tests passed");
return Failures; return Failures != 0; // not the count: `crafter-build test` takes an exit status of 77 for a skipped suite, and an exit status keeps 8 bits
} }

View file

@ -512,5 +512,5 @@ int main() {
} }
if (Failures == 0) std::println("Messages: all tests passed"); if (Failures == 0) std::println("Messages: all tests passed");
return Failures; return Failures != 0; // not the count: `crafter-build test` takes an exit status of 77 for a skipped suite, and an exit status keeps 8 bits
} }

View file

@ -90,5 +90,5 @@ int main() {
} }
if (Failures == 0) std::println("Qmi: all tests passed"); if (Failures == 0) std::println("Qmi: all tests passed");
return Failures; return Failures != 0; // not the count: `crafter-build test` takes an exit status of 77 for a skipped suite, and an exit status keeps 8 bits
} }

View file

@ -396,5 +396,5 @@ int main() {
} }
if (Failures == 0) std::println("Sdp: all tests passed"); if (Failures == 0) std::println("Sdp: all tests passed");
return Failures; return Failures != 0; // not the count: `crafter-build test` takes an exit status of 77 for a skipped suite, and an exit status keeps 8 bits
} }

View file

@ -137,5 +137,5 @@ int main() {
} }
if (Failures == 0) std::println("Util: all tests passed"); if (Failures == 0) std::println("Util: all tests passed");
return Failures; return Failures != 0; // not the count: `crafter-build test` takes an exit status of 77 for a skipped suite, and an exit status keeps 8 bits
} }