redding / assert

Assertion style testing framework.
https://github.com/redding/assert
MIT License
10 stars 1 forks source link

make the CLI exit status be `1` on failing test suite runs #308

Closed kellyredding closed 3 years ago

kellyredding commented 3 years ago

Before it was just hardcoded to exit(0) after all test suite runs. This breaks unix conventions and CI conventions that expect system commands to exit with a non-zero status if they fail.

This switches to checking the fails + errors count returned from the runner and if that count is not zero, exit(1). I chose to always exit with 1 instead of e.g. the fails plus errors count b/c POSIX exit status are 32-bit and cap out at 255.

I also chose to add SUCCESS_EXIT_STATUS and ERROR_EXIT_STATUS constants to remove the "magic integer" code smell.