mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-03 15:35:17 +00:00
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.
This commit is contained in:
committed by
Tomek Mrugalski
parent
b860eba5ab
commit
aa964794b6
@@ -38,14 +38,14 @@ FAILED=
|
|||||||
|
|
||||||
# Find all the tests (yes, doing it by a name is a nasty hack)
|
# 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
|
# 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"
|
sed -e 's#exec "#exec valgrind '"$FLAGS"' "#' "$testname" > "$testname.valgrind"
|
||||||
chmod +x "$testname.valgrind"
|
chmod +x "$testname.valgrind"
|
||||||
echo "$testname" >>"$LOGFILE"
|
echo "$testname" >>"$LOGFILE"
|
||||||
echo "===============" >>"$LOGFILE"
|
echo "===============" >>"$LOGFILE"
|
||||||
OLDDIR="`pwd`"
|
OLDDIR="`pwd`"
|
||||||
cd $(dirname "$testname")
|
cd $(dirname "$testname")
|
||||||
./run_unittests.valgrind >&2 &
|
./$(basename $testname).valgrind >&2 &
|
||||||
PID="$!"
|
PID="$!"
|
||||||
set +e
|
set +e
|
||||||
wait "$PID"
|
wait "$PID"
|
||||||
@@ -59,8 +59,10 @@ eval $(find . -type f -name run_unittests -print | grep -v '\.libs/run_unittests
|
|||||||
NAME="$LOGFILE.$PID"
|
NAME="$LOGFILE.$PID"
|
||||||
rm "$testname.valgrind"
|
rm "$testname.valgrind"
|
||||||
# Remove the ones from death tests
|
# Remove the ones from death tests
|
||||||
grep "==$PID==" "$NAME" >>"$LOGFILE"
|
if [ -e $NAME ]; then
|
||||||
rm "$NAME"
|
grep "==$PID==" "$NAME" >>"$LOGFILE"
|
||||||
|
rm "$NAME"
|
||||||
|
fi
|
||||||
echo 'FOUND_ANY=true'
|
echo 'FOUND_ANY=true'
|
||||||
done)
|
done)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user