summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorJacob Champion <jchampion@apache.org>2017-05-25 21:18:32 +0000
committerJacob Champion <jchampion@apache.org>2017-05-25 21:18:32 +0000
commitd3289c73ee5f053dc99ccb8546624017e83cca8b (patch)
treeb6bd7bc9e87d1f33c41294a8dbdeb255ad52f569 /configure.in
parent1b223229a188d0559b08b2c1fa38bfd0b6b4eed4 (diff)
downloadhttpd-d3289c73ee5f053dc99ccb8546624017e83cca8b.tar.gz
httpdunit: a Check-based unit test suite
Add a unit test suite based on Check: https://libcheck.github.io/check/ The suite depends on the build system to automatically generate the code stubs that call every test case. httpdunit is automatically enabled in the build if configure is able to find Check via pkg-config. At the moment pkg-config is the only official (non-deprecated) way to build and link against Check with an autoconf system, since platforms may distribute Check as a static library. Note that Check is an LGPL'd library, so we can't distribute test objects and binaries. Building and running the suite remains optional and is not required to run the server. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/httpdunit@1796202 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in16
1 files changed, 16 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 0309d77c43..ef7bd02482 100644
--- a/configure.in
+++ b/configure.in
@@ -706,6 +706,22 @@ AC_ARG_WITH(valgrind,
fi ]
)
+dnl Enable the unit test executable if Check is installed.
+dnl TODO: at the moment, only pkg-config discovery is supported.
+AC_MSG_CHECKING([for Check to enable unit tests])
+if test "x$PKGCONFIG" != "x" && `$PKGCONFIG --atleast-version='0.9.12' check`; then
+ UNITTEST_CFLAGS=`$PKGCONFIG --cflags check`
+ UNITTEST_LIBS=`$PKGCONFIG --libs check`
+ other_targets="$other_targets test/httpdunit"
+
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_RESULT([no])
+fi
+APACHE_SUBST(UNITTEST_CFLAGS)
+APACHE_SUBST(UNITTEST_LIBS)
+
+
prefix="$orig_prefix"
APACHE_ENABLE_MODULES