Return a successful test run as a non-zero exit status

This commit is contained in:
Fabio Manganiello 2021-02-24 19:58:24 +01:00
parent b7f56d8dcc
commit 110ab8abfb
1 changed files with 11 additions and 4 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
BASE_DIR=$(pwd)
BASE_DIR="$(pwd)"
VENV_DIR="$BASE_DIR/venv"
REPO_DIR="$BASE_DIR/repo"
TEST_LOG="$BASE_DIR/test.log"
@ -33,7 +33,8 @@ run_tests() {
check_test_results() {
grep -e '^FAILED' "$TEST_LOG" >/dev/null
if [[ $? == 0 ]]; then
ret=$?
if [[ $ret == 0 ]]; then
echo "------------------"
echo "Some tests failed!"
echo "------------------"
@ -41,6 +42,8 @@ check_test_results() {
else
echo "All tests passed"
fi
return $ret
}
########
@ -51,6 +54,10 @@ cleanup
prepare_venv
install_repo
run_tests
check_test_results
cleanup
check_test_results
tests_passed=$?
cleanup
exit $tests_passed