[master] 182e96ff7 Extract the VTC "make check" logic to vtc.am

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Feb 13 21:45:10 UTC 2020


commit 182e96ff73925dea016195832e31443cbf4992ed
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Thu Feb 13 20:39:13 2020 +0100

    Extract the VTC "make check" logic to vtc.am
    
    The effect is currently the same, but for VMODs we shouldn't need a
    complete configure step.
    
    Refs #3184

diff --git a/bin/varnishtest/Makefile.am b/bin/varnishtest/Makefile.am
index 7324b7473..4ebff33a8 100644
--- a/bin/varnishtest/Makefile.am
+++ b/bin/varnishtest/Makefile.am
@@ -1,18 +1,11 @@
 #
 
-VTC_LOG_COMPILER = ./varnishtest -v -i
-TEST_EXTENSIONS = .vtc
 TESTS = @VTC_TESTS@
 
-# Make sure we run check-local first
-check-am: check-local
-# See if list of checks have changed, recheck
-check-local:
-	@mkdir -p tests ; \
-	LC_ALL=C; \
-	if [ "$$(cd $(srcdir) && echo tests/*.vtc)" != "@VTC_TESTS@" ]; then \
-		cd $(top_builddir) && ./config.status --recheck ; \
-	fi
+vtc-refresh-tests:
+	@cd $(top_builddir) && ./config.status --recheck
+
+include $(top_srcdir)/vtc.am
 
 DISTCLEANFILES = _.ok
 
diff --git a/vtc.am b/vtc.am
new file mode 100644
index 000000000..26ad611c3
--- /dev/null
+++ b/vtc.am
@@ -0,0 +1,21 @@
+# This file helps set up a varnishtest execution without a traditional
+# pre-defined list of tests. Test cases are expected to be located in a
+# tests/ directory relative to the Makefile's source directory.
+#
+# When a difference is detected, a refresh is triggered by calling the
+# vtc-refresh-tests target that must be defined in the including Makefile.
+#
+# The current assumption is that all the tests for the Makefile are VTCs
+# and may be revisited if needed.
+
+VTC_LOG_COMPILER = $(top_builddir)/bin/varnishtest/varnishtest -v -i
+TEST_EXTENSIONS = .vtc
+
+check-am: vtc-check-tests
+
+vtc-check-tests:
+	@mkdir -p tests \
+	LC_ALL=C; \
+	if [ "$$(cd $(srcdir) && echo tests/*.vtc)" != "$(TESTS)" ]; then \
+		$(MAKE) $(AM_MAKEFLAGS) vtc-refresh-tests ; \
+	fi


More information about the varnish-commit mailing list