summaryrefslogtreecommitdiffstats
path: root/m4/pdns_enable_unit_tests.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/pdns_enable_unit_tests.m4')
-rw-r--r--m4/pdns_enable_unit_tests.m418
1 files changed, 18 insertions, 0 deletions
diff --git a/m4/pdns_enable_unit_tests.m4 b/m4/pdns_enable_unit_tests.m4
new file mode 100644
index 0000000..f34fbe0
--- /dev/null
+++ b/m4/pdns_enable_unit_tests.m4
@@ -0,0 +1,18 @@
+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=$enableval],
+ [enable_unit_tests=no]
+ )
+ AC_MSG_RESULT([$enable_unit_tests])
+ AM_CONDITIONAL([UNIT_TESTS], [test "x$enable_unit_tests" != "xno"])
+
+ AS_IF([test "x$enable_unit_tests" != "xno"], [
+ BOOST_TEST([mt])
+ AS_IF([test "$boost_cv_lib_unit_test_framework" = "no"], [
+ AC_MSG_ERROR([Boost Unit Test library not found])
+ ])
+ ])
+])