Fail tests if Valgrind enabled and reports errors.

Also dump the failing valgrind report to stdout (not the cleanest
solution, but better than nothing).
This commit is contained in:
Darren Tucker 2019-07-18 11:09:38 +10:00
parent d1c491ecb9
commit a192021fed
1 changed files with 15 additions and 0 deletions

View File

@ -587,6 +587,21 @@ start_sshd ()
# kill sshd
cleanup
if [ "x$USE_VALGRIND" != "x" ]; then
# wait for any running process to complete
wait; sleep 1
VG_ERROR=0
for i in $OBJ/valgrind-out/*; do
if grep "ERROR SUMMARY" $i >/dev/null && \
! grep "ERROR SUMMARY: 0 errors" $i >/dev/null; then
RESULT=1
verbose valgrind failure $i
cat $i
fi
done
fi
if [ $RESULT -eq 0 ]; then
verbose ok $tid
else