+2012-10-01 Mark Wielaard <mjw@redhat.com>
+
+ * configure.ac: Add --enable-valgrind check.
+ * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Add --enable-valgrind.
+
2012-08-27 Mark Wielaard <mjw@redhat.com>
* configure.ac: Set version to 0.155.
# Make sure the test install uses lib64 when $LIB will yield lib64.
# Make sure the test build uses the same compiler, which on e.g. ppc64
# determines which platform we are actually testing.
+# Run all tests under valgrind.
DISTCHECK_CONFIGURE_FLAGS = \
--libdir=`echo $(libdir) | sed "s,^$(exec_prefix),$$dc_install_base,"`\
+ --enable-valgrind \
CC="$(CC)"
distcheck-hook:
fi
AM_CONDITIONAL(GCOV, test "$use_gcov" = yes)
+AC_ARG_ENABLE([valgrind],
+AS_HELP_STRING([--enable-valgrind],[run all tests under valgrind]),
+[use_valgrind=$enableval], [use_valgrind=no])
+if test "$use_valgrind" = yes; then
+ AC_CHECK_PROG(HAVE_VALGRIND, valgrind, yes, no)
+ if test "$HAVE_VALGRIND" = "no"; then
+ AC_MSG_ERROR([valgrind not found])
+ fi
+fi
+AM_CONDITIONAL(USE_VALGRIND, test "$use_valgrind" = yes)
+
AM_CONDITIONAL(BUILD_STATIC, [dnl
test "$use_mudflap" = yes -o "$use_gprof" = yes -o "$use_gcov" = yes])
+2012-10-01 Mark Wielaard <mjw@redhat.com>
+
+ * Makefile.am (TESTS_ENVIRONMENT): Define valgrind_cmd if USE_VALGRIND.
+ * test-wrapper.sh: Export VALGRIND_CMD if available.
+ * test-subr.sh (built_testrun): Use VALGRIND_CMD to invoke test prog.
+ (installed_testrun): Likewise.
+
2012-09-24 Petr Machata <pmachata@redhat.com>
* testfile63.bz2: New testfile.
run-readelf-vmcoreinfo.sh testfile62.bz2 \
run-readelf-mixed-corenote.sh testfile63.bz2
+if USE_VALGRIND
+valgrind_cmd="valgrind -q --trace-children=yes --error-exitcode=1"
+endif
+
installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \
bindir=$(DESTDIR)$(bindir) \
LC_ALL=C LANG=C \
+ VALGRIND_CMD=$(valgrind_cmd) \
$(srcdir)/test-wrapper.sh \
installed $(tests_rpath) \
$(program_transform_name)
if STANDALONE
TESTS_ENVIRONMENT = $(installed_TESTS_ENVIRONMENT)
else !STANDALONE
-TESTS_ENVIRONMENT = LC_ALL=C LANG=C $(srcdir)/test-wrapper.sh \
+TESTS_ENVIRONMENT = LC_ALL=C LANG=C VALGRIND_CMD=$(valgrind_cmd) \
+ $(srcdir)/test-wrapper.sh \
../libdw:../backends:../libelf:../libasm
installcheck-local:
built_testrun()
{
LD_LIBRARY_PATH="${built_library_path}${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"\
- "$@"
+ $VALGRIND_CMD "$@"
}
installed_testrun()
if [ "${libdir}" != /usr/lib ] && [ "${libdir}" != /usr/lib64 ]; then
LD_LIBRARY_PATH="${libdir}:${libdir}/elfutils\
${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" \
- $program ${1+"$@"}
+ $VALGRIND_CMD $program ${1+"$@"}
else
- $program ${1+"$@"}
+ $VALGRIND_CMD $program ${1+"$@"}
fi
}
;;
esac
+if [ "x$VALGRIND_CMD" != "x" ]; then
+ export VALGRIND_CMD
+fi
+
exec "$@"