summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorOlivier Clavel <olivier.clavel@gmail.com>2017-02-10 18:04:50 +0100
committerTomek Mrugalski <tomasz@isc.org>2017-04-04 17:13:14 +0200
commitaa964794b68dbb623beacd3f0eab86d13480ee36 (patch)
tree3f7a2bdf315d7ec2193c2c5e6ef26e226366cd59 /tools
parentMerge branch 'master' of ssh://git.kea.isc.org/git/kea (diff)
downloadkea-aa964794b68dbb623beacd3f0eab86d13480ee36.tar.xz
kea-aa964794b68dbb623beacd3f0eab86d13480ee36.zip
Various Fixes for testing in valgrind
1- Some test names differ from default run_unnittest (e.g bin/dhcpv4/dhcpv4_unittest) 2- For some reason I didn't get, some test do not produce a valgrind.$PID file, in which case the script exits. Fix this so that it continues.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/tests_in_valgrind.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/tests_in_valgrind.sh b/tools/tests_in_valgrind.sh
index 14e91ba464..f759b43573 100755
--- a/tools/tests_in_valgrind.sh
+++ b/tools/tests_in_valgrind.sh
@@ -38,14 +38,14 @@ FAILED=
# Find all the tests (yes, doing it by a name is a nasty hack)
# Since the while runs in a subprocess, we need to get the assignments out, done by the eval
-eval $(find . -type f -name run_unittests -print | grep -v '\.libs/run_unittests$' | while read testname ; do
+eval $(find . -type f -name *_unittests -print | grep -v '\.libs/' | while read testname ; do
sed -e 's#exec "#exec valgrind '"$FLAGS"' "#' "$testname" > "$testname.valgrind"
chmod +x "$testname.valgrind"
echo "$testname" >>"$LOGFILE"
echo "===============" >>"$LOGFILE"
OLDDIR="`pwd`"
cd $(dirname "$testname")
- ./run_unittests.valgrind >&2 &
+ ./$(basename $testname).valgrind >&2 &
PID="$!"
set +e
wait "$PID"
@@ -59,8 +59,10 @@ eval $(find . -type f -name run_unittests -print | grep -v '\.libs/run_unittests
NAME="$LOGFILE.$PID"
rm "$testname.valgrind"
# Remove the ones from death tests
- grep "==$PID==" "$NAME" >>"$LOGFILE"
- rm "$NAME"
+ if [ -e $NAME ]; then
+ grep "==$PID==" "$NAME" >>"$LOGFILE"
+ rm "$NAME"
+ fi
echo 'FOUND_ANY=true'
done)