summaryrefslogtreecommitdiffstats
path: root/tools/tests_in_valgrind.sh
diff options
context:
space:
mode:
authorAndrei Pavel <andrei@isc.org>2020-12-13 19:22:54 +0100
committerAndrei Pavel <andrei@isc.org>2020-12-14 11:08:39 +0100
commit49d8ce20ddbe07dae41c95ce966519592359f9e4 (patch)
tree58b885b412cc49bb744bd368512e016822af4eb9 /tools/tests_in_valgrind.sh
parent[#1574] use dhcp_test_lib.sh in src/lib/log (diff)
downloadkea-49d8ce20ddbe07dae41c95ce966519592359f9e4.tar.xz
kea-49d8ce20ddbe07dae41c95ce966519592359f9e4.zip
[#1574] remove the last unintended set +e
Diffstat (limited to 'tools/tests_in_valgrind.sh')
-rwxr-xr-xtools/tests_in_valgrind.sh15
1 files changed, 6 insertions, 9 deletions
diff --git a/tools/tests_in_valgrind.sh b/tools/tests_in_valgrind.sh
index 08e9bd62aa..0ed84feaf1 100755
--- a/tools/tests_in_valgrind.sh
+++ b/tools/tests_in_valgrind.sh
@@ -45,7 +45,8 @@ 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
-find . -type f -name '*_unittests' -print | grep -Fv '.libs/' | while read -r testname ; do
+set -x
+for testname in $(find . -type f -name '*_unittests' -print | grep -Fv '.libs/'); do
sed -e 's#exec "#exec valgrind '"$FLAGS"' "#' "$testname" > "$testname.valgrind"
chmod +x "$testname.valgrind"
echo "$testname" >>"$LOGFILE"
@@ -54,23 +55,19 @@ find . -type f -name '*_unittests' -print | grep -Fv '.libs/' | while read -r te
cd "$(dirname "$testname")"
"./$(basename "$testname").valgrind" >&2 &
PID="$!"
- set +e
- wait "$PID"
- CODE="$?"
- set -e
cd "$OLDDIR"
- if [ "$CODE" != 0 ] ; then
+ if ! wait "$PID"; then
printf 'FAILED="%s
%s"' "${FAILED}" "${testname}"
fi
NAME="$LOGFILE.$PID"
rm "$testname.valgrind"
# Remove the ones from death tests
- if [ -e "${NAME}" ]; then
+ if test -e "${NAME}"; then
grep "==$PID==" "$NAME" >>"$LOGFILE"
rm "$NAME"
fi
- echo 'FOUND_ANY=true'
+ FOUND_ANY=true
done
if test -n "$FAILED"; then
@@ -78,7 +75,7 @@ if test -n "$FAILED"; then
echo "$FAILED" >&2
fi
-if ! $FOUND_ANY ; then
+if ! $FOUND_ANY; then
echo "No test was found. It is possible you configured without --with-gtest or you run it from wrong directory" >&2
exit 1
fi