summaryrefslogtreecommitdiffstats
path: root/tools/tests_in_valgrind.sh
diff options
context:
space:
mode:
authorMichal 'vorner' Vaner <michal.vaner@nic.cz>2011-02-24 21:02:39 +0100
committerMichal 'vorner' Vaner <michal.vaner@nic.cz>2011-02-24 21:02:39 +0100
commit923a47079606a6ba9368d94007b3c24aaa4ca7e5 (patch)
tree5f493041402ce71bb2b9cf28765666a458155df1 /tools/tests_in_valgrind.sh
parent[trac614] First cut at an ugly script (diff)
downloadkea-923a47079606a6ba9368d94007b3c24aaa4ca7e5.tar.xz
kea-923a47079606a6ba9368d94007b3c24aaa4ca7e5.zip
[trac614] Functional fixes
* Don't fail on test crash * Better escaping of IPC in the script * Run from the tests' dir, so they find their files
Diffstat (limited to 'tools/tests_in_valgrind.sh')
-rwxr-xr-xtools/tests_in_valgrind.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/tests_in_valgrind.sh b/tools/tests_in_valgrind.sh
index ccbe82140a..7d680f5190 100755
--- a/tools/tests_in_valgrind.sh
+++ b/tools/tests_in_valgrind.sh
@@ -10,11 +10,11 @@ if [ $? = 2 ] ; then
exit 1
fi
-set -ex
+set -e
# Some configuration
# TODO Escape for sed, this might break
-LOGFILE="${VALGRIND_FILE:-valgrind.log}"
+LOGFILE="${VALGRIND_FILE:-`pwd`/valgrind.log}"
FLAGS="${VALGRIND_FLAGS:---read-var-info=yes --leak-check=full}"
FLAGS="$FLAGS --log-file=$LOGFILE.%p"
@@ -28,13 +28,17 @@ eval $(find . -type f -executable -name run_unittests -print | grep -v '\.libs/r
chmod +x "$testname.valgrind"
echo "$testname" >>"$LOGFILE"
echo "===============" >>"$LOGFILE"
- "$testname.valgrind" >&2 &
+ pushd $(dirname "$testname") >/dev/null
+ "./run_unittests.valgrind" >&2 &
PID="$!"
+ set +e
wait "$PID"
CODE="$?"
+ set -e
+ popd >/dev/null
if [ "$CODE" != 0 ] ; then
echo 'FAILED="$FAILED
-'"'$testname'"
+'"$testname"'"'
fi
NAME="$LOGFILE.$PID"
rm "$testname.valgrind"