From e25ee629c6dfa47c13121cc70b2da1b2dd21036c Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Mon, 19 Aug 2013 11:08:56 +0800 Subject: test: Add --enable-test-valgrind Add an --enable-test-valgrind argument to configure, to run all tests under valgrind, configured to fail on leaked memory Signed-off-by: Jeremy Kerr --- configure.ac.in | 8 ++++++++ test/Makefile.am | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/configure.ac.in b/configure.ac.in index 8372b98..be372a6 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -173,6 +173,14 @@ AC_ARG_ENABLE( ) #AM_CONDITIONAL([ENABLE_DEBUG], [test "x$enable_debug" = "xyes"]) +AC_ARG_ENABLE( + [test-valgrind], + [AS_HELP_STRING([--enable-test-valgrind], + [run all tests with valgrind] + )], +) +AM_CONDITIONAL([ENABLE_TEST_VALGRIND], [test "x$enable_test_valgrind" = "xyes"]) + # host program paths AC_DEFUN([DEFINE_HOST_PROG], [ diff --git a/test/Makefile.am b/test/Makefile.am index f2f4176..6562836 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -11,6 +11,11 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +if ENABLE_TEST_VALGRIND +LOG_COMPILER = valgrind +AM_LOG_FLAGS = --leak-check=full --error-exitcode=1 +export LOG_COMPILER AM_LOG_FLAGS +endif SUBDIRS = lib parser urls -- cgit v1.1