From f4366504b9fef13f15f53b029c90e810cbc44e2d Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sat, 4 Jun 2016 18:27:52 +0200 Subject: [PATCH] unit tests: Run all tests through Valgrind's memcheck, if available. --- configure.ac | 3 +++ src/Makefile.am | 2 ++ src/daemon/Makefile.am | 2 ++ 3 files changed, 7 insertions(+) diff --git a/configure.ac b/configure.ac index 99d665de..beb30c28 100644 --- a/configure.ac +++ b/configure.ac @@ -57,6 +57,9 @@ AC_PROG_LIBTOOL AC_PROG_LEX AC_PROG_YACC +AC_PATH_PROG([VALGRIND], [valgrind]) +AC_SUBST([VALGRIND]) + # Warn when pkg.m4 is missing m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config]) diff --git a/src/Makefile.am b/src/Makefile.am index 66792961..67c25335 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -17,6 +17,8 @@ endif AM_CPPFLAGS += -DPLUGINDIR='"${pkglibdir}"' AM_CPPFLAGS += -DPKGDATADIR='"${pkgdatadir}"' +LOG_COMPILER = env VALGRIND="@VALGRIND@" $(abs_top_srcdir)/testwrapper.sh + V_PROTOC = $(v_protoc_@AM_V@) v_protoc_ = $(v_protoc_@AM_DEFAULT_V@) v_protoc_0 = @echo " PROTOC " $@; diff --git a/src/daemon/Makefile.am b/src/daemon/Makefile.am index d59e8234..632872a2 100644 --- a/src/daemon/Makefile.am +++ b/src/daemon/Makefile.am @@ -87,6 +87,8 @@ else collectd_LDADD += -loconfig endif +LOG_COMPILER = env VALGRIND="@VALGRIND@" $(abs_top_srcdir)/testwrapper.sh + check_PROGRAMS = test_common test_meta_data test_utils_avltree test_utils_heap test_utils_time test_utils_subst TESTS = test_common test_meta_data test_utils_avltree test_utils_heap test_utils_time test_utils_subst -- 2.11.0