From 0d64fc5d22c16c91bf6d80ee18190625b5dc57ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20N=C4=9Bmec?= Date: Wed, 20 Oct 2021 14:44:09 +0200 Subject: tests: run-tests.sh: ensure non-zero exit when $failed != 0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Phil Sutter --- tests/shell/run-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/shell/run-tests.sh') diff --git a/tests/shell/run-tests.sh b/tests/shell/run-tests.sh index 349ec6cb..f77d850e 100755 --- a/tests/shell/run-tests.sh +++ b/tests/shell/run-tests.sh @@ -160,4 +160,4 @@ echo "" msg_info "results: [OK] $ok [FAILED] $failed [TOTAL] $((ok+failed))" kernel_cleanup -exit $failed +[ "$failed" -eq 0 ] -- cgit v1.2.3