Skip to content

Commit

Permalink
scripts: Exit with 1 when retdec-tests-runner.sh did not run any tests (
Browse files Browse the repository at this point in the history
#238).

Previously, it exited with 0, which is undesirable.
  • Loading branch information
s3rvac committed Mar 5, 2018
1 parent def3bcd commit d28767d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/retdec-tests-runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")"
Expand All @@ -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
}

#
Expand Down

0 comments on commit d28767d

Please sign in to comment.