[master] 26a401822 build: Move the VMODs tests out of the boilerplate

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Jan 7 14:16:07 UTC 2021


commit 26a401822e7d6fb42d3d02c56c58d845d2c33962
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Tue Jan 5 16:45:01 2021 +0100

    build: Move the VMODs tests out of the boilerplate
    
    We can't have more than one test suite if we put all VMODs in the same
    directory.

diff --git a/lib/libvcc/vmodtool.py b/lib/libvcc/vmodtool.py
index 956ec6165..4250b816b 100755
--- a/lib/libvcc/vmodtool.py
+++ b/lib/libvcc/vmodtool.py
@@ -88,19 +88,6 @@ CLEANFILES = $(builddir)/PFX.c $(builddir)/PFX.h \\
 \t$(builddir)/vmod_XXX.man.rst
 '''
 
-AMBOILERPLATE_CHECK = '''
-TESTS = \\
-\tVTC
-
-EXTRA_DIST += $(TESTS)
-
-vtc-refresh-tests:
-\t at PYTHON@ $(vmodtool) $(vmodtoolargs) $(srcdir)/VCC
-\t at cd $(top_builddir) && ./config.status --file=$(subdir)/Makefile
-
-include $(top_srcdir)/vtc.am
-'''
-
 PRIVS = {
     'PRIV_CALL':   "struct vmod_priv *",
     'PRIV_VCL':    "struct vmod_priv *",
@@ -992,11 +979,6 @@ class vcc(object):
         fo.write(AMBOILERPLATE.replace("XXX", self.modname)
                  .replace("VCC", vcc)
                  .replace("PFX", self.pfx))
-        tests = glob.glob("tests/*.vtc")
-        if len(tests) > 0:
-            tests.sort()
-            fo.write(AMBOILERPLATE_CHECK.replace("VCC", vcc).
-                    replace("VTC", " \\\n\t".join(tests)))
         fo.close()
 
     def mkdefs(self, fo):
diff --git a/lib/libvmod_cookie/Makefile.am b/lib/libvmod_cookie/Makefile.am
index 1a0b6a6d0..b85531aed 100644
--- a/lib/libvmod_cookie/Makefile.am
+++ b/lib/libvmod_cookie/Makefile.am
@@ -3,3 +3,29 @@ libvmod_cookie_la_SOURCES = \
 
 # Use vmodtool.py generated automake boilerplate
 include $(srcdir)/automake_boilerplate_cookie.am
+
+TESTS = \
+	tests/cookie_b00000.vtc \
+	tests/cookie_b00001.vtc \
+	tests/cookie_b00002.vtc \
+	tests/cookie_b00003.vtc \
+	tests/cookie_b00004.vtc \
+	tests/cookie_b00005.vtc \
+	tests/cookie_b00006.vtc \
+	tests/cookie_b00007.vtc \
+	tests/cookie_b00008.vtc \
+	tests/cookie_b00009.vtc \
+	tests/cookie_b00010.vtc \
+	tests/cookie_b00011.vtc \
+	tests/cookie_b00012.vtc \
+	tests/cookie_b00013.vtc \
+	tests/cookie_r00028.vtc \
+	tests/cookie_v00000.vtc
+
+EXTRA_DIST += $(TESTS)
+
+vtc-refresh-tests:
+	@PYTHON@ $(vmodtool) $(vmodtoolargs) $(srcdir)/vmod_cookie.vcc
+	@cd $(top_builddir) && ./config.status --file=$(subdir)/Makefile
+
+include $(top_srcdir)/vtc.am
diff --git a/lib/libvmod_cookie/automake_boilerplate_cookie.am b/lib/libvmod_cookie/automake_boilerplate_cookie.am
index 8fbed5964..f03d43f1f 100644
--- a/lib/libvmod_cookie/automake_boilerplate_cookie.am
+++ b/lib/libvmod_cookie/automake_boilerplate_cookie.am
@@ -35,29 +35,3 @@ EXTRA_DIST = $(srcdir)/vmod_cookie.vcc automake_boilerplate_cookie.am
 CLEANFILES = $(builddir)/vcc_cookie_if.c $(builddir)/vcc_cookie_if.h \
 	$(builddir)/vmod_cookie.rst \
 	$(builddir)/vmod_cookie.man.rst
-
-TESTS = \
-	tests/cookie_b00000.vtc \
-	tests/cookie_b00001.vtc \
-	tests/cookie_b00002.vtc \
-	tests/cookie_b00003.vtc \
-	tests/cookie_b00004.vtc \
-	tests/cookie_b00005.vtc \
-	tests/cookie_b00006.vtc \
-	tests/cookie_b00007.vtc \
-	tests/cookie_b00008.vtc \
-	tests/cookie_b00009.vtc \
-	tests/cookie_b00010.vtc \
-	tests/cookie_b00011.vtc \
-	tests/cookie_b00012.vtc \
-	tests/cookie_b00013.vtc \
-	tests/cookie_r00028.vtc \
-	tests/cookie_v00000.vtc
-
-EXTRA_DIST += $(TESTS)
-
-vtc-refresh-tests:
-	@PYTHON@ $(vmodtool) $(vmodtoolargs) $(srcdir)/vmod_cookie.vcc
-	@cd $(top_builddir) && ./config.status --file=$(subdir)/Makefile
-
-include $(top_srcdir)/vtc.am
diff --git a/lib/libvmod_std/Makefile.am b/lib/libvmod_std/Makefile.am
index 292239d02..9126fd613 100644
--- a/lib/libvmod_std/Makefile.am
+++ b/lib/libvmod_std/Makefile.am
@@ -8,3 +8,14 @@ libvmod_std_la_SOURCES = \
 
 # Use vmodtool.py generated automake boilerplate
 include $(srcdir)/automake_boilerplate_std.am
+
+TESTS = \
+	tests/std_b00001.vtc
+
+EXTRA_DIST += $(TESTS)
+
+vtc-refresh-tests:
+	@PYTHON@ $(vmodtool) $(vmodtoolargs) $(srcdir)/vmod_std.vcc
+	@cd $(top_builddir) && ./config.status --file=$(subdir)/Makefile
+
+include $(top_srcdir)/vtc.am
diff --git a/lib/libvmod_std/automake_boilerplate_std.am b/lib/libvmod_std/automake_boilerplate_std.am
index aa859751c..f4648b226 100644
--- a/lib/libvmod_std/automake_boilerplate_std.am
+++ b/lib/libvmod_std/automake_boilerplate_std.am
@@ -35,14 +35,3 @@ EXTRA_DIST = $(srcdir)/vmod_std.vcc automake_boilerplate_std.am
 CLEANFILES = $(builddir)/vcc_std_if.c $(builddir)/vcc_std_if.h \
 	$(builddir)/vmod_std.rst \
 	$(builddir)/vmod_std.man.rst
-
-TESTS = \
-	tests/std_b00001.vtc
-
-EXTRA_DIST += $(TESTS)
-
-vtc-refresh-tests:
-	@PYTHON@ $(vmodtool) $(vmodtoolargs) $(srcdir)/vmod_std.vcc
-	@cd $(top_builddir) && ./config.status --file=$(subdir)/Makefile
-
-include $(top_srcdir)/vtc.am


More information about the varnish-commit mailing list