build: Add support for running make check with valgrind

This check if valgrind tool is available adding it to be run with make
check.
This commit is contained in:
Luiz Augusto von Dentz 2015-08-21 16:40:48 +03:00
parent 7f3eda34b5
commit a21b661c7a
3 changed files with 23 additions and 0 deletions

View File

@ -428,6 +428,12 @@ if DBUS_RUN_SESSION
AM_TESTS_ENVIRONMENT += dbus-run-session --
endif
if VALGRIND
LOG_COMPILER = valgrind --error-exitcode=1 --num-callers=30
LOG_FLAGS = --trace-children=yes --leak-check=full --show-reachable=no \
--suppressions=$(srcdir)/valgrind.supp --quiet
endif
pkgconfigdir = $(libdir)/pkgconfig
if LIBRARY

View File

@ -35,9 +35,12 @@ AC_PROG_LIBTOOL
if (test "$USE_MAINTAINER_MODE" = "yes"); then
AC_CHECK_PROG(enable_coverage, [lcov], [yes], [no])
AC_CHECK_PROG(enable_dbus_run_session, [dbus-run-session], [yes])
AC_CHECK_PROG(enable_valgrind, [valgrind], [yes])
AC_CHECK_HEADERS(valgrind/memcheck.h)
fi
AM_CONDITIONAL(COVERAGE, test "${enable_coverage}" = "yes")
AM_CONDITIONAL(DBUS_RUN_SESSION, test "${enable_dbus_run_session}" = "yes")
AM_CONDITIONAL(VALGRIND, test "${enable_valgrind}" = "yes")
MISC_FLAGS

14
valgrind.supp Normal file
View File

@ -0,0 +1,14 @@
{
ecb_bind
Memcheck:Param
socketcall.bind(my_addr.sa_data)
fun:bind
fun:ecb_aes_setup
}
{
cmac_bind
Memcheck:Param
socketcall.bind(my_addr.sa_data)
fun:bind
fun:cmac_aes_setup
}