tests: Fail if there were no tests executed. Fix #1002

This commit is contained in:
Alexander Todorov 2020-09-24 11:24:49 +03:00 committed by Ondřej Budai
parent e9b8b7e01f
commit b48bff75bf
2 changed files with 4 additions and 4 deletions

View file

@ -54,8 +54,8 @@ echo "😃 Passed tests:" "${PASSED_TESTS[@]}"
echo "☹ Failed tests:" "${FAILED_TESTS[@]}"
test_divider
# Exit with a failure if any tests failed.
if [ ${#FAILED_TESTS[@]} -eq 0 ]; then
# Exit with a failure if tests were executed and any of them failed.
if [ ${#PASSED_TESTS[@]} -gt 0 ] && [ ${#FAILED_TESTS[@]} -eq 0 ]; then
echo "🎉 All tests passed."
exit 0
else

View file

@ -92,8 +92,8 @@ echo "😃 Passed tests: " "${PASSED_TESTS[@]}"
echo "☹ Failed tests: " "${FAILED_TESTS[@]}"
test_divider
# Exit with a failure if any tests failed.
if [ ${#FAILED_TESTS[@]} -eq 0 ]; then
# Exit with a failure if tests were executed and any of them failed.
if [ ${#PASSED_TESTS[@]} -gt 0 ] && [ ${#FAILED_TESTS[@]} -eq 0 ]; then
echo "🎉 All tests passed."
exit 0
else