From: Mark Wielaard Date: Wed, 2 Dec 2015 16:27:18 +0000 (+0100) Subject: tests: Use valgrind --leak-check=full. X-Git-Tag: elfutils-0.165~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5a354b9d7d4ca8c912945dd708ab465aec67c7f;p=thirdparty%2Felfutils.git tests: Use valgrind --leak-check=full. When --enable-valgrind is given run the testsuite with --leak-check=full treating any memory leak as a failure. Also disable valgrind for those tests that trigger a valgrind bug. https://bugs.kde.org/show_bug.cgi?id=327427 Signed-off-by: Mark Wielaard --- diff --git a/tests/ChangeLog b/tests/ChangeLog index 4c56400cf..2940e3829 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,11 @@ +2015-12-02 Mark Wielaard + + * Makefile.am (valgrind_cmd): Use --leak-check=full. + * run-backtrace-demangle.sh: Disable valgrind. + * run-stack-demangled-test.sh: Likewise. + * run-stack-d-test.sh: Likewise. + * run-stack-i-test.sh: Likewise. + 2015-12-01 Mark Wielaard * test-flag-nobits.c (main): Call elf_end. diff --git a/tests/Makefile.am b/tests/Makefile.am index 30cf137c6..0077c0f59 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -307,7 +307,7 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \ run-lfs-symbols.sh lfs-symbols testfile-nolfs.bz2 if USE_VALGRIND -valgrind_cmd='valgrind -q --error-exitcode=1 --run-libc-freeres=no' +valgrind_cmd='valgrind -q --leak-check=full --error-exitcode=1' endif diff --git a/tests/run-backtrace-demangle.sh b/tests/run-backtrace-demangle.sh index 71a735181..2d2532400 100755 --- a/tests/run-backtrace-demangle.sh +++ b/tests/run-backtrace-demangle.sh @@ -26,6 +26,11 @@ child=testfile-backtrace-demangle testfiles $child{,.core} tempfiles $child.{bt,err} +# Disable valgrind while dumping because of a bug unmapping libc.so. +# https://bugs.kde.org/show_bug.cgi?id=327427 +SAVED_VALGRIND_CMD="$VALGRIND_CMD" +unset VALGRIND_CMD + # There can be more than 3 frames, but depending on the system/installed # glibc we might not be able to unwind fully till the end. # cxxfunc -> f -> main @@ -33,6 +38,12 @@ tempfiles $child.{bt,err} # (exit code 1) testrun ${abs_top_builddir}/src/stack -n 2 -e $child --core $child.core >$child.bt 2>$child.err || exitcode=$? cat $child.{bt,err} + +if [ "x$SAVED_VALGRIND_CMD" != "x" ]; then + VALGRIND_CMD="$SAVED_VALGRIND_CMD" + export VALGRIND_CMD +fi + if test $exitcode != 1 || ! grep "shown max number of frames" $child.err; then echo >&2 $2: expected more than 2 frames false diff --git a/tests/run-stack-d-test.sh b/tests/run-stack-d-test.sh index 41982014d..a9f03806f 100755 --- a/tests/run-stack-d-test.sh +++ b/tests/run-stack-d-test.sh @@ -68,6 +68,11 @@ else STACKCMD=${abs_top_builddir}/src/stack fi +# Disable valgrind while dumping because of a bug unmapping libc.so. +# https://bugs.kde.org/show_bug.cgi?id=327427 +SAVED_VALGRIND_CMD="$VALGRIND_CMD" +unset VALGRIND_CMD + # Without -d the top function comes out as fu. Use --raw to not demangle. testrun_compare ${abs_top_builddir}/src/stack -r -n 2 -e testfiledwarfinlines --core testfiledwarfinlines.core<