Skip to content

Commit d3ed858

Browse files
committed
Fix test_valgrind.sh
If a test fails, but there is no "ERROR SUMMARY" string in the LOG, the LOG is removed and the whole test fails with the following error message: ls: cannot access 'umf_test-*.log': No such file or directory This patch fixes that. Signed-off-by: Lukasz Dorau <[email protected]>
1 parent 27d2ce8 commit d3ed858

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/test_valgrind.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@ for test in $(ls -1 umf_test-*); do
121121

122122
[ "$FILTER" != "" ] && echo -n "($FILTER) "
123123

124+
LAST_FAILED=0
125+
124126
if ! HWLOC_CPUID_PATH=./cpuid valgrind $OPTION $OPT_SUP --gen-suppressions=all ./$test $FILTER >$LOG 2>&1; then
127+
LAST_FAILED=1
125128
FAIL=1
126129
echo "(valgrind FAILED) "
127130
echo "Command: HWLOC_CPUID_PATH=./cpuid valgrind $OPTION $OPT_SUP --gen-suppressions=all ./$test $FILTER >$LOG 2>&1"
@@ -132,7 +135,7 @@ for test in $(ls -1 umf_test-*); do
132135
fi || true
133136
# grep for "ERROR SUMMARY" with errors (there can be many lines with "ERROR SUMMARY")
134137
grep -e "ERROR SUMMARY:" $LOG | grep -v -e "ERROR SUMMARY: 0 errors from 0 contexts" > $ERR || true
135-
if [ $(cat $ERR | wc -l) -eq 0 ]; then
138+
if [ $LAST_FAILED -eq 0 -a $(cat $ERR | wc -l) -eq 0 ]; then
136139
echo "- OK"
137140
rm -f $LOG $ERR
138141
else

0 commit comments

Comments
 (0)