Better logic for test_passed/test_failed return value

This commit is contained in:
Fabio Manganiello 2021-02-24 21:45:18 +01:00
parent 110ab8abfb
commit 6934383a71
1 changed files with 7 additions and 6 deletions

View File

@ -32,13 +32,14 @@ run_tests() {
} }
check_test_results() { check_test_results() {
grep -e '^FAILED' "$TEST_LOG" >/dev/null failed_tests=$(grep -e '^FAILED' "$TEST_LOG" >/dev/null)
ret=$? ret=0
if [[ $ret == 0 ]]; then
if [[ ! -z "$failed_tests" ]]; then
echo "------------------" echo "------------------"
echo "Some tests failed!" echo "Some tests failed!"
echo "------------------" echo "------------------"
cat "$LOGFILE" ret=2
else else
echo "All tests passed" echo "All tests passed"
fi fi
@ -56,8 +57,8 @@ install_repo
run_tests run_tests
check_test_results check_test_results
tests_passed=$? ret=$?
cleanup cleanup
exit $tests_passed exit $ret