From c856f32b9616aac5f0803305638784e56c3f3791 Mon Sep 17 00:00:00 2001 From: Jacob Champion Date: Wed, 4 Jan 2017 23:14:27 +0000 Subject: [PATCH] Add a --with-test-suite option for "in-tree" testing Step one. It's not actually "in-tree" yet, since it requires running `make install` first, but at least it gives us a `make check`. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/trunk-test-integration@1777384 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 19 +++++++++++++++++++ configure.in | 15 +++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/Makefile.in b/Makefile.in index b166700b6f..a568b765e1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -295,5 +295,24 @@ update-log-tags update-log-msg-tags: find server modules os -name \*.c|xargs perl \ docs/log-message-tags/update-log-msg-tags +# TODO: don't require an install of the server binaries to run the tests +APXS_LOCATION := $(DESTDIR)$(bindir)/apxs + +check: + @if test "x$(TEST_SUITE_LOCATION)" = "xno"; then \ + echo 'Re-run configure with the --with-test-suite option to enable in-tree tests.'; \ + false; \ + fi + @if ! test -f "$(APXS_LOCATION)"; then \ + echo "Can't find apxs at '$(APXS_LOCATION)'"; \ + echo "Unfortunately the 'in-tree' tests don't run yet without first running 'make install'. Sorry."; \ + false; \ + fi + cd "$(TEST_SUITE_LOCATION)" && \ + perl Makefile.PL -apxs "$(APXS_LOCATION)" && \ + ./t/TEST -clean && \ + ./t/TEST -config && \ + ./t/TEST + # XXX: This looks awfully platform-specific [read: bad form and style] include $(top_srcdir)/os/os2/core.mk diff --git a/configure.in b/configure.in index 19ce9e7374..db26629e99 100644 --- a/configure.in +++ b/configure.in @@ -886,6 +886,21 @@ AC_ARG_ENABLE(bsd-makefiles,APACHE_HELP_STRING(--enable-bsd-makefiles,use BSD Ma FORCE_BSD_MAKEFILE="auto" ]) +AC_ARG_WITH([test-suite], + APACHE_HELP_STRING([--with-test-suite=PATH], [enable in-tree 'make check' with the given Apache::Test suite location]), + [ + if test "x$withval" = "xyes"; then + AC_MSG_ERROR([option --with-test-suite requires a directory]); + else + test -f "$withval/Makefile.PL" || AC_MSG_WARN([--with-test-suite directory $withval does not appear to contain the expected Makefile.PL]) + TEST_SUITE_LOCATION="$withval" + fi + ], + [ TEST_SUITE_LOCATION="no" ] +) + +APACHE_SUBST(TEST_SUITE_LOCATION) + APACHE_FAST_OUTPUT(Makefile modules/Makefile srclib/Makefile) APACHE_FAST_OUTPUT(os/Makefile server/Makefile) APACHE_FAST_OUTPUT(support/Makefile) -- 2.50.1