Skip to content
Permalink
Browse files

Generate test suite setup in vmodtool

That part of the automake boilerplate is generated conditionally, and
since we check automake_boilerplate.am files in the list of tests is
printed with one per line to be diff-friendly.

A test was "randomly" chosen to be the first VMOD-specific test.

Generated automake_boilerplate.am files no longer start nor end with
empty lines.

This is probably going to mandate some changes in vtest to collect
VMOD-specific test suites.

Refs #3184
  • Loading branch information
Dridi committed Feb 13, 2020
1 parent 6ed45b8 commit 4ace3ef6b1e670549f7f120c31d5f924622a9158
@@ -13,6 +13,7 @@ _*
*~
*.sw[op]
*.trs
*.log

# Various auto-tools artifacts
/aclocal.m4
@@ -22,8 +23,6 @@ _*
/config.guess
/config.h
/config.h.in
/config.h.in~
/config.log
/config.status
/config.sub
/configure
@@ -108,22 +107,16 @@ cscope.*out
/nbproject/private/

# Test droppings
/bin/varnishd/*.log
/bin/varnishd/vhp_decode_test
/bin/varnishd/vhp_table_test
/bin/varnishtest/*.log
/bin/varnishtest/tests/*.log
/bin/varnishtest/tests/*.log-t
/include/*.log
/include/_vrt.c
/include/_vrt_test
/include/vrt_test
/include/vbm_test
/lib/libvarnish/*.log
/lib/libvarnish/binheap
/lib/libvarnish/vjsn_test
/lib/libvarnish/vnum_c_test
/lib/libvarnishapi/*.log
/lib/libvarnishapi/vsl_glob_test
/lib/libvarnishapi/vsl_glob_test_coverage

@@ -37,6 +37,7 @@
"""

import copy
import glob
import hashlib
import json
import optparse
@@ -45,7 +46,7 @@
import sys
import time

AMBOILERPLATE = '''
AMBOILERPLATE = '''\
# Generated by vmodtool.py --boilerplate.
AM_LDFLAGS = $(AM_LT_LDFLAGS)
@@ -84,7 +85,17 @@
CLEANFILES = $(builddir)/PFX.c $(builddir)/PFX.h \\
\t$(builddir)/vmod_XXX.rst \\
\t$(builddir)/vmod_XXX.man.rst
'''

AMBOILERPLATE_CHECK = '''
TESTS = \\
\tXXX
vtc-refresh-tests:
\t@PYTHON@ $(vmodtool) $(vmodtoolargs) $(srcdir)/vmod.vcc
\t@cd $(top_builddir) && ./config.status --file=$(subdir)/Makefile
include $(top_srcdir)/vtc.am
'''

PRIVS = {
@@ -975,6 +986,9 @@ def amboilerplate(self):
fo = self.openfile("automake_boilerplate.am")
fo.write(AMBOILERPLATE.replace("XXX", self.modname)
.replace("PFX", self.pfx))
tests = glob.glob("tests/*.vtc")
if len(tests) > 0:
fo.write(AMBOILERPLATE_CHECK.replace("XXX", " \\\n\t".join(tests)))
fo.close()

def mkdefs(self, fo):
@@ -1,4 +1,3 @@

# Generated by vmodtool.py --boilerplate.

AM_LDFLAGS = $(AM_LT_LDFLAGS)
@@ -37,4 +36,3 @@ EXTRA_DIST = vmod.vcc automake_boilerplate.am
CLEANFILES = $(builddir)/vcc_if.c $(builddir)/vcc_if.h \
$(builddir)/vmod_blob.rst \
$(builddir)/vmod_blob.man.rst

@@ -1,4 +1,3 @@

# Generated by vmodtool.py --boilerplate.

AM_LDFLAGS = $(AM_LT_LDFLAGS)
@@ -37,4 +36,3 @@ EXTRA_DIST = vmod.vcc automake_boilerplate.am
CLEANFILES = $(builddir)/vcc_if.c $(builddir)/vcc_if.h \
$(builddir)/vmod_debug.rst \
$(builddir)/vmod_debug.man.rst

@@ -1,4 +1,3 @@

# Generated by vmodtool.py --boilerplate.

AM_LDFLAGS = $(AM_LT_LDFLAGS)
@@ -37,4 +36,3 @@ EXTRA_DIST = vmod.vcc automake_boilerplate.am
CLEANFILES = $(builddir)/vcc_if.c $(builddir)/vcc_if.h \
$(builddir)/vmod_directors.rst \
$(builddir)/vmod_directors.man.rst

@@ -1,4 +1,3 @@

# Generated by vmodtool.py --boilerplate.

AM_LDFLAGS = $(AM_LT_LDFLAGS)
@@ -37,4 +36,3 @@ EXTRA_DIST = vmod.vcc automake_boilerplate.am
CLEANFILES = $(builddir)/vcc_if.c $(builddir)/vcc_if.h \
$(builddir)/vmod_proxy.rst \
$(builddir)/vmod_proxy.man.rst

@@ -1,4 +1,3 @@

# Generated by vmodtool.py --boilerplate.

AM_LDFLAGS = $(AM_LT_LDFLAGS)
@@ -37,4 +36,3 @@ EXTRA_DIST = vmod.vcc automake_boilerplate.am
CLEANFILES = $(builddir)/vcc_if.c $(builddir)/vcc_if.h \
$(builddir)/vmod_purge.rst \
$(builddir)/vmod_purge.man.rst

@@ -1,4 +1,3 @@

# Generated by vmodtool.py --boilerplate.

AM_LDFLAGS = $(AM_LT_LDFLAGS)
@@ -38,3 +37,11 @@ CLEANFILES = $(builddir)/vcc_if.c $(builddir)/vcc_if.h \
$(builddir)/vmod_std.rst \
$(builddir)/vmod_std.man.rst

TESTS = \
tests/b00001.vtc

vtc-refresh-tests:
@PYTHON@ $(vmodtool) $(vmodtoolargs) $(srcdir)/vmod.vcc
@cd $(top_builddir) && ./config.status --file=$(subdir)/Makefile

include $(top_srcdir)/vtc.am
File renamed without changes.
@@ -1,4 +1,3 @@

# Generated by vmodtool.py --boilerplate.

AM_LDFLAGS = $(AM_LT_LDFLAGS)
@@ -37,4 +36,3 @@ EXTRA_DIST = vmod.vcc automake_boilerplate.am
CLEANFILES = $(builddir)/vcc_if.c $(builddir)/vcc_if.h \
$(builddir)/vmod_unix.rst \
$(builddir)/vmod_unix.man.rst

@@ -1,4 +1,3 @@

# Generated by vmodtool.py --boilerplate.

AM_LDFLAGS = $(AM_LT_LDFLAGS)
@@ -37,4 +36,3 @@ EXTRA_DIST = vmod.vcc automake_boilerplate.am
CLEANFILES = $(builddir)/vcc_if.c $(builddir)/vcc_if.h \
$(builddir)/vmod_vtc.rst \
$(builddir)/vmod_vtc.man.rst

0 comments on commit 4ace3ef

Please sign in to comment.
You can’t perform that action at this time.