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