Skip to content

Fix test_valgrind.sh #756

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions test/test_valgrind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ echo
echo "Working directory: $(pwd)"
echo "Running: \"valgrind $OPTION\" for the following tests:"

FAIL=0
ANY_TEST_FAILED=0
rm -f umf_test-*.log umf_test-*.err

for test in $(ls -1 umf_test-*); do
Expand Down Expand Up @@ -121,8 +121,11 @@ for test in $(ls -1 umf_test-*); do

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

LAST_TEST_FAILED=0

if ! HWLOC_CPUID_PATH=./cpuid valgrind $OPTION $OPT_SUP --gen-suppressions=all ./$test $FILTER >$LOG 2>&1; then
FAIL=1
LAST_TEST_FAILED=1
ANY_TEST_FAILED=1
echo "(valgrind FAILED) "
echo "Command: HWLOC_CPUID_PATH=./cpuid valgrind $OPTION $OPT_SUP --gen-suppressions=all ./$test $FILTER >$LOG 2>&1"
echo "Output:"
Expand All @@ -132,17 +135,17 @@ for test in $(ls -1 umf_test-*); do
fi || true
# grep for "ERROR SUMMARY" with errors (there can be many lines with "ERROR SUMMARY")
grep -e "ERROR SUMMARY:" $LOG | grep -v -e "ERROR SUMMARY: 0 errors from 0 contexts" > $ERR || true
if [ $(cat $ERR | wc -l) -eq 0 ]; then
if [ $LAST_TEST_FAILED -eq 0 -a $(cat $ERR | wc -l) -eq 0 ]; then
echo "- OK"
rm -f $LOG $ERR
else
echo "- FAILED!"
cat $ERR | cut -d' ' -f2-
FAIL=1
ANY_TEST_FAILED=1
fi || true
done

[ $FAIL -eq 0 ] && echo PASSED && exit 0
[ $ANY_TEST_FAILED -eq 0 ] && echo PASSED && exit 0

echo
echo "======================================================================"
Expand Down
Loading