summaryrefslogtreecommitdiffstats
path: root/tests/build
diff options
context:
space:
mode:
authorŠtěpán Němec <snemec@redhat.com>2021-10-20 14:44:09 +0200
committerPhil Sutter <phil@nwl.cc>2021-11-02 22:00:38 +0100
commit0d64fc5d22c16c91bf6d80ee18190625b5dc57ad (patch)
tree206c2eee0b3f64cd816905d0dcacfa9d77f1767c /tests/build
parenta39b9a7af845ddd97b78b285780c67042d24950d (diff)
tests: run-tests.sh: ensure non-zero exit when $failed != 0
POSIX [1] does not specify the behavior of `exit' with arguments outside the 0-255 range, but what generally (bash, dash, zsh, OpenBSD ksh, busybox) seems to happen is the shell exiting with status & 255 [2], which results in zero exit for certain non-zero arguments. [1] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#exit [2] https://git.savannah.gnu.org/cgit/bash.git/tree/builtins/common.c#n579 Fixes: 0c6592420586 ("tests: fix return codes") Signed-off-by: Štěpán Němec <snemec@redhat.com> Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'tests/build')
-rwxr-xr-xtests/build/run-tests.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/build/run-tests.sh b/tests/build/run-tests.sh
index 9ce93a8e..f78cc901 100755
--- a/tests/build/run-tests.sh
+++ b/tests/build/run-tests.sh
@@ -52,4 +52,4 @@ done
rm -rf $tmpdir
echo "results: [OK] $ok [FAILED] $failed [TOTAL] $((ok+failed))"
-exit $failed
+[ "$failed" -eq 0 ]