X-Git-Url: https://mattmccutchen.net/bigint/bigint.git/blobdiff_plain/706f6a7ec4a59f98108a6f3fd8f34fcbfd81f596..HEAD:/run-testsuite diff --git a/run-testsuite b/run-testsuite index 0c563c2..ff73729 100755 --- a/run-testsuite +++ b/run-testsuite @@ -2,9 +2,19 @@ bad= +# If you encounter the following problem with Valgrind like I did: +# https://bugzilla.redhat.com/show_bug.cgi?id=455644 +# you can pass the environment variable NO_VALGRIND=1 to run the testsuite +# without it. +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 @@ -23,5 +33,5 @@ if [ $bad ]; then echo >&2 'Test suite failed!' exit 1 else - echo 'Test suite succeeded.' + echo 'Test suite passed.' fi