5 # If you encounter the following problem with Valgrind like I did:
6 # https://bugzilla.redhat.com/show_bug.cgi?id=455644
7 # you can pass the environment variable NO_VALGRIND=1 to run the testsuite
9 if [ "$NO_VALGRIND" ]; then
12 cmd
=(valgrind
--error-exitcode=1 --leak-check=full .
/testsuite
)
16 # Stdout goes directly to testsuite.out; stderr goes down the pipe.
17 if ! "${cmd[@]}" 2>&1 >testsuite.out |
tee testsuite.err
; then
18 echo >&2 'Memory errors!'
22 if grep 'LEAK SUMMARY' testsuite.err
>/dev
/null
; then
23 echo >&2 'Memory leaks!'
27 if ! diff -u testsuite.expected testsuite.out
; then
28 echo >&2 'Output is incorrect!'
33 echo >&2 'Test suite failed!'
36 echo 'Test suite passed.'