practracker: Fail tests if any process exits unexpectedly

Part of 32705.
This commit is contained in:
teor 2020-01-14 17:20:36 +10:00
parent cda2ff1965
commit eb55d85e75
No known key found for this signature in database
GPG Key ID: 10FEAA0E7075672A

View File

@ -1,5 +1,8 @@
#!/bin/sh
# Fail if any subprocess fails unexpectedly
set -e
umask 077
TMPDIR=""
@ -37,11 +40,11 @@ run_practracker() {
--max-h-include-count=0 \
--max-include-count=0 \
--terse \
"${DATA}/" "$@";
"${DATA}/" "$@" || true
}
compare() {
# we can't use cmp because we need to use -b for windows
diff -b -u "$@" > "${TMPDIR}/test-diff"
diff -b -u "$@" > "${TMPDIR}/test-diff" || true
if test -z "$(cat "${TMPDIR}"/test-diff)"; then
echo "OK"
else
@ -53,7 +56,7 @@ compare() {
echo "unit tests:"
"${PYTHON:-python}" "${PRACTRACKER_DIR}/practracker_tests.py" || exit 1
"${PYTHON:-python}" "${PRACTRACKER_DIR}/practracker_tests.py"
echo "ex0:"