tests: [CENSORED] [CENSORED] automake [CENSORED]
authorDan Winship <danw@gnome.org>
Wed, 20 Feb 2013 00:02:59 +0000 (19:02 -0500)
committerDan Winship <danw@gnome.org>
Wed, 20 Feb 2013 00:08:18 +0000 (19:08 -0500)
Specifying serial-tests in AM_INIT_AUTOMAKE breaks the build with
automake 1.11, so the only way to support both 1.11 and 1.13 is to
make the tests work under the parallel harness. Fortunately this
wasn't that hard.

.gitignore
configure.ac
tests/Makefile.am
tests/test-utils.c

index 9fbae76..19686f4 100644 (file)
@@ -63,6 +63,9 @@ po/Makefile.in.in
 po/POTFILES
 po/stamp-it
 stamp-h1
+test-driver
+tests/*.log
+tests/*.trs
 tests/*-test
 tests/date
 tests/dns
index 781361a..1b12081 100644 (file)
@@ -11,7 +11,7 @@ AC_INIT([libsoup],[soup_major_version.soup_minor_version.soup_micro_version],[ht
 AC_CONFIG_SRCDIR([libsoup-2.4.pc.in])
 AC_CONFIG_MACRO_DIR([m4])
 
-AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz -Wno-portability serial-tests])
+AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz -Wno-portability])
 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
 
 AC_PROG_MAKE_SET
index 6f0c5ae..57ec0f4 100644 (file)
@@ -11,7 +11,7 @@ LIBS =                        \
        $(LIBGNUTLS_LIBS) \
        $(GLIB_LIBS)
 
-tests =                        \
+TESTS =                        \
        cache-test      \
        chunk-test      \
        coding-test     \
@@ -37,17 +37,17 @@ tests =                     \
        uri-parsing
 
 if HAVE_APACHE
-tests += auth-test proxy-test pull-api range-test
+TESTS += auth-test proxy-test pull-api range-test
 endif
 if HAVE_CURL
-tests += forms-test server-auth-test
+TESTS += forms-test server-auth-test
 endif
 if HAVE_XMLRPC_PHP
-tests += xmlrpc-test xmlrpc-server-test
+TESTS += xmlrpc-test xmlrpc-server-test
 endif
 
 noinst_PROGRAMS =              \
-       $(tests)                \
+       $(TESTS)                \
        dns                     \
        get                     \
        ntlm-test-helper        \
@@ -86,8 +86,6 @@ endif
 soup-tests.gresource: soup-tests.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/soup-tests.gresource.xml)
        $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir)  $<
 
-TESTS = $(sort $(tests))
-
 RESOURCES =                    \
        resources/atom.xml      \
        resources/home.gif      \
@@ -116,14 +114,29 @@ EXTRA_DIST =                       \
 
 DISTCLEANFILES = soup-tests.gresource httpd.conf
 
-check-local: check-TESTS kill-httpd
+TESTS_ENVIRONMENT = \
+       SOUP_TESTS_IN_MAKE_CHECK=1
+
+check: start-httpd
+
+check-local: check-TESTS
+       @$(MAKE) kill-httpd
 if MISSING_REGRESSION_TEST_PACKAGES
        @echo ""
        @echo "NOTE: some tests were not run due to missing packages:" $(MISSING_REGRESSION_TEST_PACKAGES)
        @echo ""
 endif
 
+.PHONY: start-httpd kill-httpd
+
+start-httpd:
+if HAVE_APACHE
+       @$(APACHE_HTTPD) -d `pwd` -f httpd.conf -k start;
+endif
+
 kill-httpd:
+if HAVE_APACHE
        @if [ -f httpd.pid ]; then \
                $(APACHE_HTTPD) -d `pwd` -f httpd.conf -k stop; \
        fi
+endif
index a2c24cf..8e0fb25 100644 (file)
@@ -187,6 +187,9 @@ apache_cmd (const char *cmd)
 void
 apache_init (void)
 {
+       if (g_getenv ("SOUP_TESTS_IN_MAKE_CHECK"))
+               return;
+
        if (!apache_cmd ("start")) {
                g_printerr ("Could not start apache\n");
                exit (1);