2014-09-21 00:03:20 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
2014-10-25 11:39:26 +02:00
|
|
|
set -e
|
|
|
|
|
|
2014-09-21 00:03:20 +02:00
|
|
|
case $# in
|
|
|
|
|
0)
|
|
|
|
|
source_dir="."
|
|
|
|
|
binary_dir="."
|
|
|
|
|
;;
|
|
|
|
|
2)
|
|
|
|
|
source_dir=$1
|
|
|
|
|
binary_dir=$2
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
echo "usage: $0 [source_dir] [binary_dir]"
|
|
|
|
|
exit 1
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
|
2014-09-25 19:25:57 +02:00
|
|
|
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 --error-exitcode=1 --quiet"
|
2014-09-21 00:03:20 +02:00
|
|
|
|
2014-12-09 09:07:47 +01:00
|
|
|
if [ ! -f "$XDG_CONFIG_HOME/mediafire-tools/config" -a ! -f ~/.config/mediafire-tools/config ]; then
|
2014-09-23 11:38:10 +02:00
|
|
|
echo "no configuration file found" >&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
2014-12-09 09:07:47 +01:00
|
|
|
|
2014-09-25 21:51:42 +02:00
|
|
|
$cmd "${binary_dir}/mediafire-shell" -c "help; ls; changes"
|