From: Timo Sirainen Date: Tue, 10 Feb 2015 11:12:42 +0000 (+0200) Subject: dovecot.m4: External plugins can now more easily run their tests via Valgrind. X-Git-Tag: 2.2.16.rc1~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd244bb810d8c9b3ea46d5fd3f51296a48255266;p=thirdparty%2Fdovecot%2Fcore.git dovecot.m4: External plugins can now more easily run their tests via Valgrind. DC_DOVECOT macro automatically adds RUN_TEST variable to Makefiles, which can be used to call any test programs. If valgrind exists, the tests are run through it. This is done by writing run-test.sh to the build directory, so the original run-test.sh in hg is no longer needed. --- diff --git a/.hgignore b/.hgignore index 001e6d326f..1f59d96f13 100644 --- a/.hgignore +++ b/.hgignore @@ -36,6 +36,7 @@ dovecot-config.in ChangeLog Makefile Makefile.in +run-test.sh *.o *.lo diff --git a/configure.ac b/configure.ac index c0be796163..993c3aa47e 100644 --- a/configure.ac +++ b/configure.ac @@ -2816,13 +2816,7 @@ if test "$docdir" = ""; then fi AC_SUBST(docdir) -AC_CHECK_PROG(VALGRIND, valgrind, yes, no) -if test $VALGRIND = yes; then - RUN_TEST='$(SHELL) $(top_srcdir)/run-test.sh' -else - RUN_TEST='' -fi -AC_SUBST(RUN_TEST) +DC_DOVECOT_TEST_WRAPPER AC_SUBST(abs_top_builddir) AC_CONFIG_HEADERS([config.h]) diff --git a/dovecot.m4 b/dovecot.m4 index 0ac1e31266..aea348af30 100644 --- a/dovecot.m4 +++ b/dovecot.m4 @@ -31,6 +31,35 @@ AC_DEFUN([DC_PLUGIN_DEPS],[ unset _plugin_deps ]) +AC_DEFUN([DC_DOVECOT_TEST_WRAPPER],[ + AC_CHECK_PROG(VALGRIND, valgrind, yes, no) + if test $VALGRIND = yes; then + cat > run-test.sh <