From: Ruben Kerkhof Date: Mon, 6 Jan 2014 12:42:08 +0000 (+0100) Subject: Move unit test check to separate macro X-Git-Tag: rec-3.6.0-rc1~264^2~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fedea66ae8b036919ea17458d333da1b397a681f;p=pdns Move unit test check to separate macro --- diff --git a/configure.ac b/configure.ac index 6771250ee..f304b65c1 100644 --- a/configure.ac +++ b/configure.ac @@ -38,14 +38,8 @@ BOOST_REQUIRE([1.35]) BOOST_FOREACH BOOST_PROGRAM_OPTIONS([mt]) BOOST_SERIALIZATION([mt]) -AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],[enable unit test building]), [enable_unit_tests=yes],[enable_unit_tests=no]) - -if test x"$enable_unit_tests" = "xyes"; then - BOOST_TEST([mt]) -fi -#BOOST_SYSTEM([mt]) - +PDNS_ENABLE_UNIT_TESTS dnl Allow user to require SQLite3 AC_MSG_CHECKING(whether user requires sqlite3) diff --git a/m4/pdns_enable_unit_tests.m4 b/m4/pdns_enable_unit_tests.m4 new file mode 100644 index 000000000..36c4ca145 --- /dev/null +++ b/m4/pdns_enable_unit_tests.m4 @@ -0,0 +1,13 @@ +AC_DEFUN([PDNS_ENABLE_UNIT_TESTS], [ + AC_MSG_CHECKING([whether to enable unit test building]) + AC_ARG_ENABLE([unit-tests], + AS_HELP_STRING([--enable-unit-tests], + [enable unit test building @<:@default=no@:>@]), + [enable_unit_tests=yes], + [enable_unit_tests=no] + ) + AC_MSG_RESULT([$enable_unit_tests]) + AS_IF([test "x$enable_unit_tests" = "xyes"], [ + BOOST_TEST([mt]) + ]) +])