Add valgrind tests and fix memleaks

This commit is contained in:
josch
2014-09-21 00:03:20 +02:00
parent 122db2ed82
commit 042a1cdf09
16 changed files with 177 additions and 18 deletions

20
tests/valgrind.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/sh
case $# in
0)
source_dir="."
binary_dir="."
;;
2)
source_dir=$1
binary_dir=$2
;;
*)
echo "usage: $0 [source_dir] [binary_dir]"
exit 1
;;
esac
cmd="valgrind --suppressions="${source_dir}/valgrind.supp" --fullpath-after="$source_dir" --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=20 --track-fds=yes --track-origins=yes"
$cmd "${binary_dir}/mfshell" -c "help; whoami"