X-Git-Url: https://mattmccutchen.net/bigint/bigint.git/blobdiff_plain/706f6a7ec4a59f98108a6f3fd8f34fcbfd81f596..cb2f0c288d4b7acfa37d7a9c8bc1024c3f332b5f:/run-testsuite diff --git a/run-testsuite b/run-testsuite index 0c563c2..116d2c9 100755 --- a/run-testsuite +++ b/run-testsuite @@ -2,9 +2,15 @@ bad= +if [ "$NO_VALGRIND" ]; then + cmd=(./testsuite) +else + cmd=(valgrind --error-exitcode=1 --leak-check=full ./testsuite) +fi + set -o pipefail -if ! valgrind --error-exitcode=1 --leak-check=full \ - ./testsuite 2>&1 >testsuite.out | tee testsuite.err; then +# Stdout goes directly to testsuite.out; stderr goes down the pipe. +if ! "${cmd[@]}" 2>&1 >testsuite.out | tee testsuite.err; then echo >&2 'Memory errors!' bad=1 fi