From 5fb3ab6ee39022b0866e7285af808736e586f119 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 18 May 2018 14:28:56 +1000 Subject: [PATCH] tests: properly set exit code. --- tests/test_misc.sh | 3 +++ tests/test_util.sh | 1 + 2 files changed, 4 insertions(+) diff --git a/tests/test_misc.sh b/tests/test_misc.sh index d5536516..6f1dd405 100755 --- a/tests/test_misc.sh +++ b/tests/test_misc.sh @@ -32,6 +32,9 @@ test_get_process_name() { printf "%s\\n" "Test MISC functions." + test_convert_time test_get_ppid test_get_process_name + +[[ -f /tmp/err ]] || exit 0 && { rm /tmp/err; exit 1; } diff --git a/tests/test_util.sh b/tests/test_util.sh index 1eecc998..32657f9a 100644 --- a/tests/test_util.sh +++ b/tests/test_util.sh @@ -7,4 +7,5 @@ assert_equals() { local status [[ "$1" == "$2" ]] && status="✔" printf "%s\\n" " ${status:-✖} : ${FUNCNAME[1]}" + [[ "$1" == "$2" ]] || { :>/tmp/err; return 1; } && return 0 }