summaryrefslogtreecommitdiff
path: root/ci/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ci/test.sh')
-rwxr-xr-xci/test.sh20
1 files changed, 13 insertions, 7 deletions
diff --git a/ci/test.sh b/ci/test.sh
index 0f8fc8783..e50e6fa9e 100755
--- a/ci/test.sh
+++ b/ci/test.sh
@@ -11,6 +11,8 @@ BUILD_DIR=$(pwd)
TMPDIR=${TMPDIR:-/tmp}
USER=${USER:-$(whoami)}
+SUCCESS=1
+
VALGRIND="valgrind --leak-check=full --show-reachable=yes --error-exitcode=125 --num-callers=50 --suppressions=\"$SOURCE_DIR/libgit2_clar.supp\""
LEAKS="MallocStackLogging=1 MallocScribble=1 leaks -quiet -atExit -- nohup"
@@ -30,11 +32,9 @@ cleanup() {
echo "Done."
}
-die() {
+failure() {
echo "Test exited with code: $1"
-
- cleanup
- exit $1
+ SUCCESS=0
}
# Ask ctest what it would run if we were to invoke it directly. This lets
@@ -54,7 +54,7 @@ run_test() {
RUNNER="$TEST_CMD"
fi
- eval $RUNNER || die $?
+ eval $RUNNER || failure
}
# Configure the test environment; run them early so that we're certain
@@ -194,10 +194,16 @@ if [ -z "$SKIP_FUZZERS" ]; then
echo "##############################################################################"
for fuzzer in fuzzers/*_fuzzer; do
- "${fuzzer}" "${SOURCE_DIR}/fuzzers/corpora/$(basename "${fuzzer%_fuzzer}")" || die $?
+ "${fuzzer}" "${SOURCE_DIR}/fuzzers/corpora/$(basename "${fuzzer%_fuzzer}")" || failure
done
fi
-echo "Success."
cleanup
+
+if [ "$SUCCESS" -ne "1" ]; then
+ echo "Some tests failed."
+ exit 1
+fi
+
+echo "Success."
exit 0