make valgrind usage easier

This commit is contained in:
TLINDEN
2014-08-07 21:31:52 +02:00
parent 9672785271
commit 3778b3f44e

20
vg.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/sh
# small valgrind helper to execute unit tests with valgrind
vg="valgrind --leak-check=full --show-reachable=yes"
cmd=$1
shift
if test -z "$cmd"; then
echo "Usage: $0 <commandline ..>"
exit 1
else
if echo "$cmd" | egrep "^\.\." > /dev/null 2>&1; then
cd tests
fi
fi
$vg $cmd $* > log 2>&1
less log
rm -f log