Bail early from test script if initial tests fail

This commit is contained in:
Jeffrey Walton 2018-10-19 07:16:35 -04:00
parent 26fcdb55cd
commit cab699d7c8
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
2 changed files with 24 additions and 0 deletions

View File

@ -1945,14 +1945,20 @@ if true; then
if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
# Stop now if things are broke
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
else
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
# Stop now if things are broke
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
# Stop now if things are broke
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
fi
@ -1973,14 +1979,20 @@ if true; then
if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
# Stop now if things are broke
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
else
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
# Stop now if things are broke
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
# Stop now if things are broke
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
echo
fi

View File

@ -1945,14 +1945,20 @@ if true; then
if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
# Stop now if things are broke
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
else
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
# Stop now if things are broke
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
# Stop now if things are broke
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
fi
@ -1973,14 +1979,20 @@ if true; then
if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
# Stop now if things are broke
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
else
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
# Stop now if things are broke
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
# Stop now if things are broke
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
echo
fi