Better logic for test_passed/test_failed return value
This commit is contained in:
parent
110ab8abfb
commit
6934383a71
1 changed files with 7 additions and 6 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue