From e2e9e4647ae1baf3de116bc52f1f73b8cf221c76 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Fri, 4 Aug 2017 17:38:17 +0300 Subject: Switch to new acvmod --- Makefile.am | 27 +++++++------------ acvmod | 2 +- configure.ac | 6 ++--- git2chg.awk | 75 ----------------------------------------------------- src/Makefile.am | 36 +++++++++++++------------ src/variable.c | 39 ++++++++++++++-------------- src/variable.vcc | 20 +++++++++++++- tests/atlocal.in | 7 +++-- tests/clear.at | 4 +-- tests/complex.at | 4 +-- tests/defined.at | 4 +-- tests/duration.at | 4 +-- tests/gstring.at | 4 +-- tests/int.at | 4 +-- tests/queryset00.at | 6 ++--- tests/queryset01.at | 6 ++--- tests/real.at | 4 +-- tests/regset.at | 6 ++--- tests/string.at | 4 +-- tests/testsuite.at | 48 +++++++--------------------------- tests/type_of.at | 4 +-- tests/unset.at | 4 +-- 22 files changed, 113 insertions(+), 205 deletions(-) delete mode 100644 git2chg.awk diff --git a/Makefile.am b/Makefile.am index 9afba47..dc90c44 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,30 +1,23 @@ -# This file is part of vmod-variable -# Copyright (C) 2013-2016 Sergey Poznyakoff -# -# Vmod-variable is free software; you can redistribute it and/or modify +# This file is part of vmod_variable. +# Copyright (C) 2017 Sergey Poznyakoff +# +# Vmod_variable is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. -# -# Vmod-variable is distributed in the hope that it will be useful, +# +# Vmod_variable is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License -# along with vmod-variable. If not, see . +# along with vmod_variable. If not, see . + ACLOCAL_AMFLAGS = -I m4 -I acvmod SUBDIRS = src tests -AM_DISTCHECK_CONFIGURE_FLAGS=--without-vmoddir - -EXTRA_DIST=git2chg.awk +include acvmod/top.am -.PHONY: ChangeLog -ChangeLog: - $(AM_V_GEN)if test -d .git; then \ - git log --pretty='format:%ct %an <%ae>%n%n%s%n%n%b%n' | \ - awk -f $(top_srcdir)/git2chg.awk > ChangeLog; \ - fi diff --git a/acvmod b/acvmod index f064cf4..7cbce8e 160000 --- a/acvmod +++ b/acvmod @@ -1 +1 @@ -Subproject commit f064cf4d7aa1ead1f8607b8b72baf883f015ffc8 +Subproject commit 7cbce8ec30898fcc19e3ba25f367156a5859ea8c diff --git a/configure.ac b/configure.ac index ca5c8f7..2f163d0 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ # This file is part of vmod-variable -*- autoconf -*- -# Copyright (C) 2015-2016 Sergey Poznyakoff +# Copyright (C) 2015-2017 Sergey Poznyakoff # # Vmod-variable is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License # along with vmod-variable. If not, see . AC_PREREQ(2.69) -AC_INIT([vmod-variable], [1.0.90-4.1.0], [gray@gnu.org]) +AC_INIT([vmod-variable], [1.0.92], [gray@gnu.org]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR(src/variable.vcc) @@ -49,7 +49,7 @@ AC_CHECK_FUNCS(sysinfo getloadavg) AC_CHECK_LIB(pcre, pcre_compile,, AC_MSG_ERROR([required library libpcre not found])) -AM_VARNISHAPI +AM_VARNISHAPI([4.1]) AC_CONFIG_TESTDIR(tests) AC_CONFIG_FILES([tests/Makefile tests/atlocal]) diff --git a/git2chg.awk b/git2chg.awk deleted file mode 100644 index 1e75254..0000000 --- a/git2chg.awk +++ /dev/null @@ -1,75 +0,0 @@ -# This file is part of grecs -# Copyright (C) 2007, 2009-2012 Sergey Poznyakoff -# -# Grecs is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# Grecs is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Grecs. If not, see . - -BEGIN { - if (since) - split(since,since_a,"-") -} - -function timeok(t, a) { - if (!since) - return 1 - split(t,a,"-") - if (a[1] < since_a[1]) - return 0 - if (a[1] > since_a[1]) - return 1 - if (a[2] < since_a[2]) - return 0 - if (a[2] > since_a[2]) - return 1 - return a[3] > since_a[3] -} - -/^[0-9]+ .* +<[^>]+>/ { - s = strftime("%F", $1) - if (!timeok(s)) - exit - sub(/^[0-9]+ +/,"") - if (s == datestr && author == $0) - next - datestr = s - author = $0 - if (runlen) { runlen = 0; print "" } - printf("%s %s\n", datestr, author) - next -} -/^Signed-off-by:/ { next } -/^$/ { next } -NF==0 { - runlen++ - next -} -{ if (runlen) { runlen = 0; print "" } - print "\t" $0 } - -END { - if (append) { - print "" - while ((getline < append) > 0) { - if (match($0, /^Local *Variables:/)) - break - print - } - } - print "\f" - # Make sure Emacs won't recognize this line: - print "Local", "Variables:" - print "mode: change-log" - print "version-control: never" - print "buffer-read-only: t" - print "End:" -} diff --git a/src/Makefile.am b/src/Makefile.am index 5396773..bf5eee8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,27 +1,23 @@ -# This file is part of vmod-variable -# Copyright (C) 2015, 2016 Sergey Poznyakoff -# -# Vmod-variable is free software; you can redistribute it and/or modify +# This file is part of vmod_variable. +# Copyright (C) 2017 Sergey Poznyakoff +# +# Vmod_variable is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. -# -# Vmod-variable is distributed in the hope that it will be useful, +# +# Vmod_variable is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License -# along with vmod-variable. If not, see . +# along with vmod_variable. If not, see . AM_CPPFLAGS=\ - -I$(VARNISHSRC)/include\ - -I$(VARNISHSRC)/bin/varnishd\ - -I$(VARNISHSRC)\ + $(VARNISHAPI_CFLAGS)\ -DLOCALSTATEDIR=\"$(localstatedir)\" -dist_man_MANS=vmod-variable.3 vmod_variable.3 - vmoddir = $(VMODDIR) vmod_LTLIBRARIES = libvmod_variable.la @@ -38,14 +34,20 @@ variable.lo: vcc_if.h CLEANFILES = vcc_if.c vcc_if.h *.rst -vmodtool = $(VARNISHSRC)/lib/libvcc/vmodtool.py vmodtoolargs = --strict vccfile = $(top_srcdir)/src/variable.vcc -vcc_if.c vcc_if.h: $(vmodtool) $(vccfile) - $(AM_V_GEN)$(PYTHON) $(vmodtool) $(vmodtoolargs) $(vccfile) +vcc_if.c vcc_if.h: $(vccfile) + $(AM_V_GEN)$(PYTHON) $(VARNISHAPI_VMODTOOL) $(vmodtoolargs) $(vccfile) EXTRA_DIST = \ - variable.vcc + variable.vcc\ + vmod_variable.man.rst\ + vmod_variable.rst + +dist_man_MANS=vmod_variable.3 vmod-variable.3 + +DISTCLEANFILES=vmod_variable.3 + diff --git a/src/variable.c b/src/variable.c index 8e75ea2..feaaa21 100644 --- a/src/variable.c +++ b/src/variable.c @@ -1,5 +1,5 @@ /* This file is part of vmod-variable - Copyright (C) 2013-2016 Sergey Poznyakoff + Copyright (C) 2013-2017 Sergey Poznyakoff Vmod-variable is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,9 +24,8 @@ #include "vrt.h" #include "vcc_if.h" #include "pthread.h" +#include "cache/cache.h" -#include "bin/varnishd/cache/cache.h" -#define VARIABLE_CTX const struct vrt_ctx * #define WSPTR(s) ((s)->ws) /* |hash_size| defines a sequence of symbol table sizes. These are prime @@ -308,7 +307,7 @@ static struct symtab *global_symtab; static pthread_mutex_t global_mtx = PTHREAD_MUTEX_INITIALIZER; VCL_VOID -vmod_global_set(VARIABLE_CTX ctx, VCL_STRING name, VCL_STRING value) +vmod_global_set(VRT_CTX, VCL_STRING name, VCL_STRING value) { struct variable *var; int inst; @@ -331,7 +330,7 @@ vmod_global_set(VARIABLE_CTX ctx, VCL_STRING name, VCL_STRING value) } VCL_STRING -vmod_global_get(VARIABLE_CTX ctx, VCL_STRING name) +vmod_global_get(VRT_CTX, VCL_STRING name) { char *s; struct variable *var; @@ -350,13 +349,13 @@ vmod_global_get(VARIABLE_CTX ctx, VCL_STRING name) } VCL_BOOL -vmod_global_defined(VARIABLE_CTX ctx, VCL_STRING name) +vmod_global_defined(VRT_CTX, VCL_STRING name) { return !!vmod_global_get(ctx, name); } VCL_VOID -vmod_global_clear(VARIABLE_CTX ctx) +vmod_global_clear(VRT_CTX) { AZ(pthread_mutex_lock(&global_mtx)); symtab_clear(global_symtab); @@ -364,7 +363,7 @@ vmod_global_clear(VARIABLE_CTX ctx) } VCL_VOID -vmod_global_unset(VARIABLE_CTX ctx, VCL_STRING name) +vmod_global_unset(VRT_CTX, VCL_STRING name) { AZ(pthread_mutex_lock(&global_mtx)); symtab_remove(global_symtab, name); @@ -406,13 +405,13 @@ defvar(struct symtab *vt, const char *name, enum variable_type t, } VCL_VOID -vmod_clear(VARIABLE_CTX ctx, struct vmod_priv *priv) +vmod_clear(VRT_CTX, struct vmod_priv *priv) { symtab_clear(get_symtab(priv)); } VCL_STRING -vmod_get_string(VARIABLE_CTX ctx, struct vmod_priv *priv, VCL_STRING name) +vmod_get_string(VRT_CTX, struct vmod_priv *priv, VCL_STRING name) { struct variable *var = getvar(get_symtab(priv), name); if (var && var->type == variable_string) @@ -421,7 +420,7 @@ vmod_get_string(VARIABLE_CTX ctx, struct vmod_priv *priv, VCL_STRING name) } VCL_VOID -vmod_set_string(VARIABLE_CTX ctx, struct vmod_priv *priv, +vmod_set_string(VRT_CTX, struct vmod_priv *priv, VCL_STRING name, VCL_STRING value) { struct symtab *vt = get_symtab(priv); @@ -432,13 +431,13 @@ vmod_set_string(VARIABLE_CTX ctx, struct vmod_priv *priv, } VCL_STRING -vmod_get(VARIABLE_CTX ctx, struct vmod_priv *priv, VCL_STRING name) +vmod_get(VRT_CTX, struct vmod_priv *priv, VCL_STRING name) { return vmod_get_string(ctx, priv, name); } VCL_VOID -vmod_set(VARIABLE_CTX ctx, struct vmod_priv *priv, +vmod_set(VRT_CTX, struct vmod_priv *priv, VCL_STRING name, VCL_STRING value) { vmod_set_string(ctx, priv, name, value); @@ -447,7 +446,7 @@ vmod_set(VARIABLE_CTX ctx, struct vmod_priv *priv, #define __cat__(a,b) a ## b #define DEFGET(r_type, vcl_type, memb) \ vcl_type \ -__cat__(vmod_get_,r_type)(VARIABLE_CTX ctx, struct vmod_priv *priv, \ +__cat__(vmod_get_,r_type)(VRT_CTX, struct vmod_priv *priv, \ VCL_STRING name) \ { \ struct variable *var = getvar(get_symtab(priv), name); \ @@ -458,7 +457,7 @@ __cat__(vmod_get_,r_type)(VARIABLE_CTX ctx, struct vmod_priv *priv, \ #define DEFSET(r_type, vcl_type, memb) \ VCL_VOID \ -__cat__(vmod_set_,r_type)(VARIABLE_CTX ctx, struct vmod_priv *priv, \ +__cat__(vmod_set_,r_type)(VRT_CTX, struct vmod_priv *priv, \ VCL_STRING name, \ vcl_type value) \ { \ @@ -477,20 +476,20 @@ DEF(real, VCL_REAL, r) DEF(duration, VCL_DURATION, d) VCL_BOOL -vmod_defined(VARIABLE_CTX ctx, struct vmod_priv *priv, VCL_STRING name) +vmod_defined(VRT_CTX, struct vmod_priv *priv, VCL_STRING name) { return !!getvar(get_symtab(priv), name); } VCL_STRING -vmod_type_of(VARIABLE_CTX ctx, struct vmod_priv *priv, VCL_STRING name) +vmod_type_of(VRT_CTX, struct vmod_priv *priv, VCL_STRING name) { struct variable *var = getvar(get_symtab(priv), name); return typestr[var ? var->type : variable_unset]; } VCL_VOID -vmod_unset(VARIABLE_CTX ctx, struct vmod_priv *priv, VCL_STRING name) +vmod_unset(VRT_CTX, struct vmod_priv *priv, VCL_STRING name) { symtab_remove(get_symtab(priv), name); } @@ -704,7 +703,7 @@ setval(union value *val, const char *s, enum variable_type type, char **err) } VCL_VOID -vmod_regset(VARIABLE_CTX ctx, struct vmod_priv *priv, +vmod_regset(VRT_CTX, struct vmod_priv *priv, VCL_STRING vars, VCL_STRING rxs, VCL_STRING input) { struct symtab *vt = get_symtab(priv); @@ -880,7 +879,7 @@ define_param(struct symtab *vt, struct vardef *def, } VCL_VOID -vmod_queryset(VARIABLE_CTX ctx, struct vmod_priv *priv, +vmod_queryset(VRT_CTX, struct vmod_priv *priv, VCL_STRING vars, VCL_STRING query) { struct symtab *vt = get_symtab(priv); diff --git a/src/variable.vcc b/src/variable.vcc index b2888fa..c309218 100644 --- a/src/variable.vcc +++ b/src/variable.vcc @@ -1,5 +1,5 @@ # This file is part of vmod-variable -# Copyright (C) 2015, 2016 Sergey Poznyakoff +# Copyright (C) 2015-2017 Sergey Poznyakoff # # Vmod-variable is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,25 +23,43 @@ only prototypes of the functions provided by the **vmod-variable** module. For a detailed documentation, please see vmod-variable(3) manual page. $Function VOID set(PRIV_TASK, STRING, STRING) + $Function STRING get(PRIV_TASK, STRING) + $Function VOID global_set(STRING, STRING) + $Function STRING global_get(STRING) + $Function VOID set_int(PRIV_TASK, STRING, INT) + $Function INT get_int(PRIV_TASK, STRING) + $Function VOID set_string(PRIV_TASK, STRING, STRING) + $Function STRING get_string(PRIV_TASK, STRING) + $Function VOID set_real(PRIV_TASK, STRING, REAL) + $Function REAL get_real(PRIV_TASK, STRING) + $Function VOID set_duration(PRIV_TASK, STRING, DURATION) + $Function DURATION get_duration(PRIV_TASK, STRING) + $Function VOID clear(PRIV_TASK) $Function VOID global_clear() + $Function BOOL global_defined(STRING) + $Function VOID global_unset(STRING) $Function BOOL defined(PRIV_TASK, STRING) + $Function STRING type_of(PRIV_TASK, STRING) + $Function VOID unset(PRIV_TASK, STRING) + $Function VOID regset(PRIV_TASK, STRING, STRING, STRING) + $Function VOID queryset(PRIV_TASK, STRING, STRING) diff --git a/tests/atlocal.in b/tests/atlocal.in index 6cae626..f229f09 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -1,10 +1,9 @@ # @configure_input@ -*- shell-script -*- # Configurable variable values for vmod-variable test suite. -# Copyright (C) 2015 Sergey Poznyakoff +# Copyright (C) 2015, 2017 Sergey Poznyakoff PATH=@abs_builddir@:@abs_top_builddir@/src:@abs_top_srcdir@/build-aux:$top_srcdir:$srcdir:$PATH +VARNISHTEST=@VARNISHTEST@ +VARNISHD=@VARNISHD@ INITFILE=@abs_builddir@/.TESTINIT FAILFILE=@abs_builddir@/FAILURE -VARNISHTEST="@VARNISHSRC@/bin/varnishtest/varnishtest -Dvarnishd=@VARNISHSRC@/bin/varnishd/varnishd" -VARNISHVERSION=@VARNISHVERSION@ - diff --git a/tests/clear.at b/tests/clear.at index a3c602f..3705c64 100644 --- a/tests/clear.at +++ b/tests/clear.at @@ -1,5 +1,5 @@ # This file is part of vmod-variable -*- autotest -*- -# Copyright (C) 2015 Sergey Poznyakoff +# Copyright (C) 2017 Sergey Poznyakoff # # Vmod-variable is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ AT_SETUP(clear) AT_KEYWORDS(clear) -AT_VARNISHTEST([ +AT_VARNISHTEST([variable],[ sub vcl_recv { variable.set("foo", req.http.Host); variable.set("bar","two"); diff --git a/tests/complex.at b/tests/complex.at index 77a7903..16fe573 100644 --- a/tests/complex.at +++ b/tests/complex.at @@ -1,5 +1,5 @@ # This file is part of vmod-variable -*- autotest -*- -# Copyright (C) 2015 Sergey Poznyakoff +# Copyright (C) 2015, 2017 Sergey Poznyakoff # # Vmod-variable is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ AT_SETUP(complex) AT_KEYWORDS(complex) -AT_VARNISHTEST([ +AT_VARNISHTEST([variable],[ sub vcl_recv { variable.set("foo", req.http.Host); variable.set("bar","two"); diff --git a/tests/defined.at b/tests/defined.at index 36fbe7f..3d0d071 100644 --- a/tests/defined.at +++ b/tests/defined.at @@ -1,5 +1,5 @@ # This file is part of vmod-variable -*- autotest -*- -# Copyright (C) 2015 Sergey Poznyakoff +# Copyright (C) 2015, 2017 Sergey Poznyakoff # # Vmod-variable is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ AT_SETUP(defined) AT_KEYWORDS(defined) -AT_VARNISHTEST([ +AT_VARNISHTEST([variable],[ sub vcl_recv { variable.set("string", "test"); } diff --git a/tests/duration.at b/tests/duration.at index 5368145..0a3f1b7 100644 --- a/tests/duration.at +++ b/tests/duration.at @@ -1,5 +1,5 @@ # This file is part of vmod-variable -*- autotest -*- -# Copyright (C) 2015 Sergey Poznyakoff +# Copyright (C) 2015, 2017 Sergey Poznyakoff # # Vmod-variable is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ AT_SETUP(duration) AT_KEYWORDS(duration) -AT_VARNISHTEST([ +AT_VARNISHTEST([variable],[ sub vcl_recv { variable.set_duration("minute", 1m); variable.set_duration("hour",1h); diff --git a/tests/gstring.at b/tests/gstring.at index 8a93dfe..bcf7beb 100644 --- a/tests/gstring.at +++ b/tests/gstring.at @@ -1,5 +1,5 @@ # This file is part of vmod-variable -*- autotest -*- -# Copyright (C) 2015 Sergey Poznyakoff +# Copyright (C) 2015, 2017 Sergey Poznyakoff # # Vmod-variable is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ AT_SETUP(global string) AT_KEYWORDS(global string gstring) -AT_VARNISHTEST([ +AT_VARNISHTEST([variable],[ sub vcl_recv { if (req.url == "/") { variable.global_set("host", req.http.Host); diff --git a/tests/int.at b/tests/int.at index 7b193cf..1a7a50b 100644 --- a/tests/int.at +++ b/tests/int.at @@ -1,5 +1,5 @@ # This file is part of vmod-variable -*- autotest -*- -# Copyright (C) 2015 Sergey Poznyakoff +# Copyright (C) 2015, 2017 Sergey Poznyakoff # # Vmod-variable is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ AT_SETUP(int) AT_KEYWORDS(int) -AT_VARNISHTEST([ +AT_VARNISHTEST([variable],[ sub vcl_recv { variable.set_int("ten", 10); variable.set_int("five",5); diff --git a/tests/queryset00.at b/tests/queryset00.at index f56e19a..230f0a5 100644 --- a/tests/queryset00.at +++ b/tests/queryset00.at @@ -1,5 +1,5 @@ # This file is part of vmod-variable -*- autotest -*- -# Copyright (C) 2015 Sergey Poznyakoff +# Copyright (C) 2015, 2017 Sergey Poznyakoff # # Vmod-variable is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ AT_SETUP(all variables) AT_KEYWORDS(queryset queryset00) -AT_VARNISHTEST([ +AT_VARNISHTEST([variable],[ sub vcl_recv { variable.queryset("", regsub(req.url, ".*\?(.+)", "\1")); } @@ -36,4 +36,4 @@ expect resp.http.X-Foo == "quz@example.com" AT_CLEANUP - \ No newline at end of file + diff --git a/tests/queryset01.at b/tests/queryset01.at index 4f70ae2..3a9b7fb 100644 --- a/tests/queryset01.at +++ b/tests/queryset01.at @@ -1,5 +1,5 @@ # This file is part of vmod-variable -*- autotest -*- -# Copyright (C) 2015 Sergey Poznyakoff +# Copyright (C) 2015, 2017 Sergey Poznyakoff # # Vmod-variable is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ AT_SETUP(selected variables) AT_KEYWORDS(queryset queryset01) -AT_VARNISHTEST([ +AT_VARNISHTEST([variable],[ sub vcl_recv { variable.queryset("x:i,foo", regsub(req.url, ".*\?(.+)", "\1")); } @@ -36,4 +36,4 @@ expect resp.http.X-Foo == "quz" AT_CLEANUP - \ No newline at end of file + diff --git a/tests/real.at b/tests/real.at index 3500480..6692991 100644 --- a/tests/real.at +++ b/tests/real.at @@ -1,5 +1,5 @@ # This file is part of vmod-variable -*- autotest -*- -# Copyright (C) 2015 Sergey Poznyakoff +# Copyright (C) 2015, 2017 Sergey Poznyakoff # # Vmod-variable is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ AT_SETUP(real) AT_KEYWORDS(real) -AT_VARNISHTEST([ +AT_VARNISHTEST([variable],[ sub vcl_recv { variable.set_real("one-half", 0.5); variable.set_real("one-fourth",0.25); diff --git a/tests/regset.at b/tests/regset.at index cc92578..d942ad2 100644 --- a/tests/regset.at +++ b/tests/regset.at @@ -1,5 +1,5 @@ # This file is part of vmod-variable -*- autotest -*- -# Copyright (C) 2015 Sergey Poznyakoff +# Copyright (C) 2015, 2017 Sergey Poznyakoff # # Vmod-variable is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ AT_SETUP(regset) AT_KEYWORDS(regset) -AT_VARNISHTEST([ +AT_VARNISHTEST([variable],[ sub vcl_recv { variable.regset("y:i,x,time:d=\3s", "^/(\d+)/(.+)/(\d+)", req.url); } @@ -36,4 +36,4 @@ expect resp.http.X-Time == "60.000" AT_CLEANUP - \ No newline at end of file + diff --git a/tests/string.at b/tests/string.at index 698ca4a..8d9c82e 100644 --- a/tests/string.at +++ b/tests/string.at @@ -1,5 +1,5 @@ # This file is part of vmod-variable -*- autotest -*- -# Copyright (C) 2015 Sergey Poznyakoff +# Copyright (C) 2015, 2017 Sergey Poznyakoff # # Vmod-variable is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ AT_SETUP(string) AT_KEYWORDS(string) -AT_VARNISHTEST([ +AT_VARNISHTEST([variable],[ sub vcl_recv { variable.set("foo", req.http.Host); variable.set("bar","two"); diff --git a/tests/testsuite.at b/tests/testsuite.at index 4f39be9..6b6c14f 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -1,50 +1,22 @@ -# This file is part of vmod-variable -*- autotest -*- -# Copyright (C) 2015 Sergey Poznyakoff -# -# Vmod-variable is free software; you can redistribute it and/or modify +# This file is part of vmod_variable. +# Copyright (C) 2017 Sergey Poznyakoff +# +# Vmod_variable is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. -# -# Vmod-variable is distributed in the hope that it will be useful, +# +# Vmod_variable is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License -# along with vmod-variable. If not, see . - -m4_version_prereq([2.52g]) - -m4_define([AT_SKIP_TEST],[exit 77]) - -dnl AT_VARNISHTEST(VCL, CLT[, SRV]) -m4_define([AT_VARNISHTEST],[ -AT_CHECK([ -cat > test.vtc <. +m4_include([../acvmod/testsuite.inc]) AT_INIT +# Include your tests here m4_include([string.at]) m4_include([int.at]) m4_include([real.at]) diff --git a/tests/type_of.at b/tests/type_of.at index 8d8b7e8..a67507e 100644 --- a/tests/type_of.at +++ b/tests/type_of.at @@ -1,5 +1,5 @@ # This file is part of vmod-variable -*- autotest -*- -# Copyright (C) 2015 Sergey Poznyakoff +# Copyright (C) 2015, 2017 Sergey Poznyakoff # # Vmod-variable is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ AT_SETUP(type_of) AT_KEYWORDS(type_of) -AT_VARNISHTEST([ +AT_VARNISHTEST([variable],[ sub vcl_recv { variable.set("s", "test"); variable.set_int("i", 1); diff --git a/tests/unset.at b/tests/unset.at index 5d88e06..330b852 100644 --- a/tests/unset.at +++ b/tests/unset.at @@ -1,5 +1,5 @@ # This file is part of vmod-variable -*- autotest -*- -# Copyright (C) 2015 Sergey Poznyakoff +# Copyright (C) 2015, 2017 Sergey Poznyakoff # # Vmod-variable is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ AT_SETUP(unset) AT_KEYWORDS(unset) -AT_VARNISHTEST([ +AT_VARNISHTEST([variable],[ sub vcl_recv { variable.set("s", "test"); variable.set("t", "foo"); -- cgit v1.2.1