author | Alpar Juttner <alpar@cs.elte.hu> |
Wed, 28 Nov 2012 11:54:43 +0100 | |
changeset 1008 | d216e1c8b3fa |
permissions | -rwxr-xr-x |
ladanyi@793 | 1 |
#!/bin/sh |
ladanyi@793 | 2 |
|
ladanyi@793 | 3 |
# Run in valgrind, with leak checking enabled |
ladanyi@793 | 4 |
|
ladanyi@793 | 5 |
valgrind -q --leak-check=full "$@" 2> .valgrind-log |
ladanyi@793 | 6 |
|
ladanyi@793 | 7 |
# Save the test result |
ladanyi@793 | 8 |
|
ladanyi@793 | 9 |
result="$?" |
ladanyi@793 | 10 |
|
ladanyi@793 | 11 |
# Valgrind should generate no error messages |
ladanyi@793 | 12 |
|
ladanyi@793 | 13 |
log_contents="`cat .valgrind-log`" |
ladanyi@793 | 14 |
|
ladanyi@793 | 15 |
if [ "$log_contents" != "" ]; then |
ladanyi@793 | 16 |
cat .valgrind-log >&2 |
ladanyi@793 | 17 |
result=1 |
ladanyi@793 | 18 |
fi |
ladanyi@793 | 19 |
|
ladanyi@793 | 20 |
rm -f .valgrind-log |
ladanyi@793 | 21 |
|
ladanyi@793 | 22 |
exit $result |