aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_parseconf.sh
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2019-11-04 11:18:10 +1000
committerteor <teor@torproject.org>2019-11-05 11:08:36 +1000
commit3763dd998753280684888db97b7fba55b351d79d (patch)
tree23605d36fe5c41427512ef2094e90adda60d7f94 /src/test/test_parseconf.sh
parent1dd6717db5016e59f8910c98276c820f447f33ff (diff)
downloadtor-3763dd998753280684888db97b7fba55b351d79d.tar.gz
tor-3763dd998753280684888db97b7fba55b351d79d.zip
test/parseconf: Run all the tests, even if one fails
Obviously correct fixes on already reviewed code.
Diffstat (limited to 'src/test/test_parseconf.sh')
-rwxr-xr-xsrc/test/test_parseconf.sh18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/test/test_parseconf.sh b/src/test/test_parseconf.sh
index a224573a20..cd7cccb32b 100755
--- a/src/test/test_parseconf.sh
+++ b/src/test/test_parseconf.sh
@@ -118,7 +118,9 @@ else
EXITCODE=1
fi
-die() { echo "$1" >&2 ; exit "$EXITCODE"; }
+FINAL_EXIT=0
+
+die() { echo "$1" >&2 ; FINAL_EXIT=$EXITCODE; }
if test "$WINDOWS" = 1; then
FILTER="dos2unix"
@@ -166,7 +168,7 @@ for dir in "${EXAMPLEDIR}"/*; do
echo "FAIL: Found both ${dir}/expected${suffix}" >&2
echo "and ${dir}/error${suffix}." >&2
echo "(Only one of these files should exist.)" >&2
- exit $EXITCODE
+ FINAL_EXIT=$EXITCODE
fi
EXPECTED="./expected${suffix}"
@@ -201,7 +203,7 @@ for dir in "${EXAMPLEDIR}"/*; do
if ! cmp "${DATA_DIR}/output.${testname}" \
"${DATA_DIR}/output_2.${testname}"; then
echo "FAIL: did not match on round-trip." >&2
- exit $EXITCODE
+ FINAL_EXIT=$EXITCODE
fi
echo "OK"
@@ -217,7 +219,7 @@ for dir in "${EXAMPLEDIR}"/*; do
echo "FAIL: did not match." >&2
diff -u "$EXPECTED" "${DATA_DIR}/output.${testname}" >&2 \
|| true
- exit $EXITCODE
+ FINAL_EXIT=$EXITCODE
fi
elif test -f "$ERROR"; then
@@ -226,7 +228,7 @@ for dir in "${EXAMPLEDIR}"/*; do
if ! test -s "$ERROR"; then
echo "FAIL: error file '$ERROR' is empty." >&2
echo "Empty error files match any output." >&2
- exit $EXITCODE
+ FINAL_EXIT=$EXITCODE
fi
"${TOR_BINARY}" --verify-config \
@@ -244,7 +246,7 @@ for dir in "${EXAMPLEDIR}"/*; do
echo "Expected error: ${expect_err}" >&2
echo "Tor said:" >&2
cat "${DATA_DIR}/output.${testname}" >&2
- exit $EXITCODE
+ FINAL_EXIT=$EXITCODE
fi
else
@@ -252,9 +254,11 @@ for dir in "${EXAMPLEDIR}"/*; do
# call that an error.
echo "FAIL: Did not find ${dir}/*expected or ${dir}/*error." >&2
- exit $EXITCODE
+ FINAL_EXIT=$EXITCODE
fi
cd "${PREV_DIR}"
done
+
+exit $FINAL_EXIT