From d28767d96ff293a32fd5b6212b6d9863f9b3d10b Mon Sep 17 00:00:00 2001 From: Petr Zemek Date: Mon, 5 Mar 2018 18:10:30 +0100 Subject: [PATCH] scripts: Exit with 1 when retdec-tests-runner.sh did not run any tests (#238). Previously, it exited with 0, which is undesirable. --- scripts/retdec-tests-runner.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/retdec-tests-runner.sh b/scripts/retdec-tests-runner.sh index e4e8d1835..799b876a4 100644 --- a/scripts/retdec-tests-runner.sh +++ b/scripts/retdec-tests-runner.sh @@ -83,6 +83,7 @@ unit_tests_in_dir() { run_unit_tests_in_dir() { UNIT_TESTS_DIR="$1" TESTS_FAILED="0" + TESTS_RUN="0" for unit_test in $(unit_tests_in_dir "$UNIT_TESTS_DIR"); do echo "" unit_test_name="$(sed 's/^.*\/bin\///' <<< "$unit_test")" @@ -102,8 +103,13 @@ run_unit_tests_in_dir() { echo_colored "FAILED (return code $RC)\n" "red" fi fi + TESTS_RUN="1" done - [ "$TESTS_FAILED" = "1" ] && return 1 || return 0 + if [ "$TESTS_FAILED" = "1" ] || [ "$TESTS_RUN" = "0" ]; then + return 1 + else + return 0 + fi } #