]> granicus.if.org Git - pdns/commitdiff
Move unit test check to separate macro
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Mon, 6 Jan 2014 12:42:08 +0000 (13:42 +0100)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Mon, 6 Jan 2014 13:27:01 +0000 (14:27 +0100)
configure.ac
m4/pdns_enable_unit_tests.m4 [new file with mode: 0644]

index 6771250ee9b16f813d1fb733e99bbedc3ce3c6b4..f304b65c10a571f0d2c88b647e25509265759874 100644 (file)
@@ -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 (file)
index 0000000..36c4ca1
--- /dev/null
@@ -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])
+   ])
+])