diff options
-rw-r--r-- | Makefile.am | 21 | ||||
m--------- | acvmod | 0 | ||||
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | git2chg.awk | 75 | ||||
-rw-r--r-- | src/Makefile.am | 30 | ||||
-rw-r--r-- | src/variable.c | 39 | ||||
-rw-r--r-- | src/variable.vcc | 20 | ||||
-rw-r--r-- | tests/atlocal.in | 7 | ||||
-rw-r--r-- | tests/clear.at | 4 | ||||
-rw-r--r-- | tests/complex.at | 4 | ||||
-rw-r--r-- | tests/defined.at | 4 | ||||
-rw-r--r-- | tests/duration.at | 4 | ||||
-rw-r--r-- | tests/gstring.at | 4 | ||||
-rw-r--r-- | tests/int.at | 4 | ||||
-rw-r--r-- | tests/queryset00.at | 4 | ||||
-rw-r--r-- | tests/queryset01.at | 4 | ||||
-rw-r--r-- | tests/real.at | 4 | ||||
-rw-r--r-- | tests/regset.at | 4 | ||||
-rw-r--r-- | tests/string.at | 4 | ||||
-rw-r--r-- | tests/testsuite.at | 42 | ||||
-rw-r--r-- | tests/type_of.at | 4 | ||||
-rw-r--r-- | tests/unset.at | 4 |
22 files changed, 100 insertions, 192 deletions
diff --git a/Makefile.am b/Makefile.am index 9afba47..dc90c44 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,11 +1,11 @@ -# This file is part of vmod-variable -# Copyright (C) 2013-2016 Sergey Poznyakoff +# This file is part of vmod_variable. +# Copyright (C) 2017 Sergey Poznyakoff # -# Vmod-variable is free software; you can redistribute it and/or modify +# 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 @@ -13,18 +13,11 @@ # # You should have received a copy of the GNU General Public License -# along with vmod-variable. If not, see <http://www.gnu.org/licenses/>. +# along with vmod_variable. If not, see <http://www.gnu.org/licenses/>. + 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 -Subproject f064cf4d7aa1ead1f8607b8b72baf883f015ffc +Subproject 7cbce8ec30898fcc19e3ba25f367156a5859ea8 diff --git a/configure.ac b/configure.ac index ca5c8f7..2f163d0 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ # 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 @@ -15,5 +15,5 @@ # along with vmod-variable. If not, see <http://www.gnu.org/licenses/>. 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]) @@ -50,5 +50,5 @@ AC_CHECK_LIB(pcre, pcre_compile,, AC_MSG_ERROR([required library libpcre not found])) -AM_VARNISHAPI +AM_VARNISHAPI([4.1]) AC_CONFIG_TESTDIR(tests) 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 <http://www.gnu.org/licenses/>. - -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 } -/^<unknown>$/ { 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,11 +1,11 @@ -# This file is part of vmod-variable -# Copyright (C) 2015, 2016 Sergey Poznyakoff +# This file is part of vmod_variable. +# Copyright (C) 2017 Sergey Poznyakoff # -# Vmod-variable is free software; you can redistribute it and/or modify +# 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 @@ -13,14 +13,10 @@ # # You should have received a copy of the GNU General Public License -# along with vmod-variable. If not, see <http://www.gnu.org/licenses/>. +# along with vmod_variable. If not, see <http://www.gnu.org/licenses/>. 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 @@ -39,13 +35,19 @@ 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,4 +1,4 @@ /* 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 @@ -25,7 +25,6 @@ #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) @@ -309,5 +308,5 @@ 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; @@ -332,5 +331,5 @@ 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; @@ -351,5 +350,5 @@ 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); @@ -357,5 +356,5 @@ vmod_global_defined(VARIABLE_CTX ctx, VCL_STRING name) VCL_VOID -vmod_global_clear(VARIABLE_CTX ctx) +vmod_global_clear(VRT_CTX) { AZ(pthread_mutex_lock(&global_mtx)); @@ -365,5 +364,5 @@ 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)); @@ -407,5 +406,5 @@ 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)); @@ -413,5 +412,5 @@ vmod_clear(VARIABLE_CTX ctx, struct vmod_priv *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); @@ -422,5 +421,5 @@ 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) { @@ -433,5 +432,5 @@ 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); @@ -439,5 +438,5 @@ vmod_get(VARIABLE_CTX ctx, struct vmod_priv *priv, VCL_STRING 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) { @@ -448,5 +447,5 @@ vmod_set(VARIABLE_CTX ctx, struct vmod_priv *priv, #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) \ { \ @@ -459,5 +458,5 @@ __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) \ @@ -478,5 +477,5 @@ 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); @@ -484,5 +483,5 @@ vmod_defined(VARIABLE_CTX ctx, struct vmod_priv *priv, VCL_STRING 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); @@ -491,5 +490,5 @@ vmod_type_of(VARIABLE_CTX ctx, struct vmod_priv *priv, VCL_STRING name) 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); @@ -705,5 +704,5 @@ 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) { @@ -881,5 +880,5 @@ 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) { diff --git a/src/variable.vcc b/src/variable.vcc index b2888fa..c309218 100644 --- a/src/variable.vcc +++ b/src/variable.vcc @@ -1,4 +1,4 @@ # 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 @@ -24,24 +24,42 @@ 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,4 +1,4 @@ # 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 @@ -18,5 +18,5 @@ AT_SETUP(clear) AT_KEYWORDS(clear) -AT_VARNISHTEST([ +AT_VARNISHTEST([variable],[ sub vcl_recv { variable.set("foo", req.http.Host); diff --git a/tests/complex.at b/tests/complex.at index 77a7903..16fe573 100644 --- a/tests/complex.at +++ b/tests/complex.at @@ -1,4 +1,4 @@ # 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 @@ -18,5 +18,5 @@ AT_SETUP(complex) AT_KEYWORDS(complex) -AT_VARNISHTEST([ +AT_VARNISHTEST([variable],[ sub vcl_recv { variable.set("foo", req.http.Host); diff --git a/tests/defined.at b/tests/defined.at index 36fbe7f..3d0d071 100644 --- a/tests/defined.at +++ b/tests/defined.at @@ -1,4 +1,4 @@ # 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 @@ -18,5 +18,5 @@ 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,4 +1,4 @@ # 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 @@ -18,5 +18,5 @@ AT_SETUP(duration) AT_KEYWORDS(duration) -AT_VARNISHTEST([ +AT_VARNISHTEST([variable],[ sub vcl_recv { variable.set_duration("minute", 1m); diff --git a/tests/gstring.at b/tests/gstring.at index 8a93dfe..bcf7beb 100644 --- a/tests/gstring.at +++ b/tests/gstring.at @@ -1,4 +1,4 @@ # 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 @@ -18,5 +18,5 @@ AT_SETUP(global string) AT_KEYWORDS(global string gstring) -AT_VARNISHTEST([ +AT_VARNISHTEST([variable],[ sub vcl_recv { if (req.url == "/") { diff --git a/tests/int.at b/tests/int.at index 7b193cf..1a7a50b 100644 --- a/tests/int.at +++ b/tests/int.at @@ -1,4 +1,4 @@ # 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 @@ -18,5 +18,5 @@ AT_SETUP(int) AT_KEYWORDS(int) -AT_VARNISHTEST([ +AT_VARNISHTEST([variable],[ sub vcl_recv { variable.set_int("ten", 10); diff --git a/tests/queryset00.at b/tests/queryset00.at index f56e19a..230f0a5 100644 --- a/tests/queryset00.at +++ b/tests/queryset00.at @@ -1,4 +1,4 @@ # 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 @@ -18,5 +18,5 @@ AT_SETUP(all variables) AT_KEYWORDS(queryset queryset00) -AT_VARNISHTEST([ +AT_VARNISHTEST([variable],[ sub vcl_recv { variable.queryset("", regsub(req.url, ".*\?(.+)", "\1")); diff --git a/tests/queryset01.at b/tests/queryset01.at index 4f70ae2..3a9b7fb 100644 --- a/tests/queryset01.at +++ b/tests/queryset01.at @@ -1,4 +1,4 @@ # 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 @@ -18,5 +18,5 @@ 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")); diff --git a/tests/real.at b/tests/real.at index 3500480..6692991 100644 --- a/tests/real.at +++ b/tests/real.at @@ -1,4 +1,4 @@ # 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 @@ -18,5 +18,5 @@ AT_SETUP(real) AT_KEYWORDS(real) -AT_VARNISHTEST([ +AT_VARNISHTEST([variable],[ sub vcl_recv { variable.set_real("one-half", 0.5); diff --git a/tests/regset.at b/tests/regset.at index cc92578..d942ad2 100644 --- a/tests/regset.at +++ b/tests/regset.at @@ -1,4 +1,4 @@ # 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 @@ -18,5 +18,5 @@ 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); diff --git a/tests/string.at b/tests/string.at index 698ca4a..8d9c82e 100644 --- a/tests/string.at +++ b/tests/string.at @@ -1,4 +1,4 @@ # 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 @@ -18,5 +18,5 @@ AT_SETUP(string) AT_KEYWORDS(string) -AT_VARNISHTEST([ +AT_VARNISHTEST([variable],[ sub vcl_recv { variable.set("foo", req.http.Host); diff --git a/tests/testsuite.at b/tests/testsuite.at index 4f39be9..6b6c14f 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -1,11 +1,11 @@ -# This file is part of vmod-variable -*- autotest -*- -# Copyright (C) 2015 Sergey Poznyakoff +# This file is part of vmod_variable. +# Copyright (C) 2017 Sergey Poznyakoff # -# Vmod-variable is free software; you can redistribute it and/or modify +# 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 @@ -13,37 +13,9 @@ # # You should have received a copy of the GNU General Public License -# along with vmod-variable. If not, see <http://www.gnu.org/licenses/>. - -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 <<EOT -server s1 { -m4_if($3,,[dnl - rxreq - txresp],[$3]) -} -start - -varnish v1 -vcl+backend { - import std; - import variable from "$abs_top_builddir/src/.libs/libvmod_variable.so"; -$1 -} -start - -client c1 { -$2 -} -run -EOT -$VARNISHTEST test.vtc | sed 's/^#.*TEST test.vtc passed.*/OK/' -], -[0], -[OK -])]) +# along with vmod_variable. If not, see <http://www.gnu.org/licenses/>. +m4_include([../acvmod/testsuite.inc]) AT_INIT +# Include your tests here m4_include([string.at]) m4_include([int.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,4 +1,4 @@ # 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 @@ -18,5 +18,5 @@ AT_SETUP(type_of) AT_KEYWORDS(type_of) -AT_VARNISHTEST([ +AT_VARNISHTEST([variable],[ sub vcl_recv { variable.set("s", "test"); diff --git a/tests/unset.at b/tests/unset.at index 5d88e06..330b852 100644 --- a/tests/unset.at +++ b/tests/unset.at @@ -1,4 +1,4 @@ # 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 @@ -18,5 +18,5 @@ AT_SETUP(unset) AT_KEYWORDS(unset) -AT_VARNISHTEST([ +AT_VARNISHTEST([variable],[ sub vcl_recv { variable.set("s", "test"); |