test: Add --enable-test-valgrind
authorJeremy Kerr <jk@ozlabs.org>
Mon, 19 Aug 2013 03:08:56 +0000 (11:08 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Mon, 19 Aug 2013 05:27:59 +0000 (13:27 +0800)
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 <jk@ozlabs.org>
configure.ac.in
test/Makefile.am

index 8372b98860ed705c21b34c3786eddc41ff26c738..be372a6337757e2be510961b75039aa4abbbf85c 100644 (file)
@@ -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],
        [
index f2f41761b58c40ceddfe0161e72d36930ee2cb1b..65628368227066222b7677e76004c9db7d293d8b 100644 (file)
 #  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