]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
practracker: Fail tests if any process exits unexpectedly
authorteor <teor@torproject.org>
Tue, 14 Jan 2020 07:20:36 +0000 (17:20 +1000)
committerteor <teor@torproject.org>
Wed, 15 Jan 2020 12:29:44 +0000 (22:29 +1000)
Part of 32705.

scripts/maint/practracker/test_practracker.sh

index 3c87bc31be8b9c055daae41666ec1a182cd391a1..43e7b0a32195e1f2167c3c54fdf40488d3687500 100755 (executable)
@@ -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:"