Don't use BASH_SOURCE in cryptest.sh

This commit is contained in:
Jeffrey Walton 2019-07-21 03:19:14 -04:00
parent ed7f4a0493
commit 3747e3d944
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
2 changed files with 18 additions and 18 deletions

View File

@ -257,7 +257,7 @@ if [[ (-z "$TMPDIR") ]]; then
TMPDIR="$HOME/tmp"
else
echo "Please set TMPDIR to a valid directory"
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
exit 1
fi
fi
@ -1949,19 +1949,19 @@ 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
exit 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
exit 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
exit 1
fi
fi
@ -1983,19 +1983,19 @@ 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
exit 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
exit 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
exit 1
fi
echo
fi
@ -7168,7 +7168,7 @@ echo
############################################
# http://tldp.org/LDP/abs/html/exitcodes.html#EXITCODESREF
if (( "$ECOUNT" == "0" )); then
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 0 || return 0
exit 0
else
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
exit 1
fi

View File

@ -257,7 +257,7 @@ if [[ (-z "$TMPDIR") ]]; then
TMPDIR="$HOME/tmp"
else
echo "Please set TMPDIR to a valid directory"
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
exit 1
fi
fi
@ -1949,19 +1949,19 @@ 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
exit 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
exit 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
exit 1
fi
fi
@ -1983,19 +1983,19 @@ 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
exit 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
exit 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
exit 1
fi
echo
fi
@ -7168,7 +7168,7 @@ echo
############################################
# http://tldp.org/LDP/abs/html/exitcodes.html#EXITCODESREF
if (( "$ECOUNT" == "0" )); then
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 0 || return 0
exit 0
else
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
exit 1
fi