[master] 04fa5d7 Use automake's support for parallel tests

Tollef Fog Heen tfheen at varnish-cache.org
Tue Jun 19 13:33:34 CEST 2012


commit 04fa5d7498f1b0b2bbf01ae877cac252ecdc6a5d
Author: Tollef Fog Heen <tfheen at varnish-software.com>
Date:   Tue Jun 19 13:30:18 2012 +0200

    Use automake's support for parallel tests
    
    In current automake, there's no way to have the list of tests be
    dynamic, so generate that when running configure as well as a local
    hook to update the list if it's changed.
    
    Also enable colourised test output.

diff --git a/bin/varnishtest/Makefile.am b/bin/varnishtest/Makefile.am
index 4562dc5..ec68889 100644
--- a/bin/varnishtest/Makefile.am
+++ b/bin/varnishtest/Makefile.am
@@ -1,11 +1,16 @@
 #
 
-TESTS_PARALLELISM = 3
-check: varnishtest
-	./varnishtest -i -j$(TESTS_PARALLELISM) $(srcdir)/tests/*.vtc
-	@echo "==================="
-	@echo "All tests succeeded"
-	@echo "==================="
+VTC_LOG_COMPILER = ./varnishtest -v -i
+TEST_EXTENSIONS = .vtc
+TESTS = @VTC_TESTS@
+
+# Make sure we run check-local first
+check: check-local check-am
+# See if list of checks have changed, recheck
+check-local:
+	if [ "$$(cd $(srcdir) && echo tests/*.vtc)" != "@VTC_TESTS@" ]; then \
+		cd $(top_builddir) && ./config.status --recheck ; \
+	fi
 
 DISTCLEANFILES = _.ok
 
diff --git a/configure.ac b/configure.ac
index 2791fd9..e1311f0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,7 +12,7 @@ OCFLAGS="$CFLAGS"
 AC_CANONICAL_SYSTEM
 AC_LANG(C)
 
-AM_INIT_AUTOMAKE([foreign])
+AM_INIT_AUTOMAKE([foreign color-tests parallel-tests])
 AC_DISABLE_STATIC
 AC_PROG_LIBTOOL
 
@@ -526,6 +526,10 @@ fi
 
 AC_DEFINE_UNQUOTED([VCC_CC],"$VCC_CC",[C compiler command line for VCL code])
 
+# Stupid automake needs this
+VTC_TESTS="$(cd $srcdir/bin/varnishtest && echo tests/*.vtc)"
+AC_SUBST(VTC_TESTS)
+
 # Generate output
 AC_CONFIG_FILES([
     Makefile



More information about the varnish-commit mailing list