m4_version_prereq([2.52g])

m4_define([AT_SKIP_TEST],[exit 77])

dnl AT_VARNISHTEST(MODULE, VCL, CLT[, SRV])
m4_define([AT_VARNISHTEST],[
AT_CHECK([
cat > test.vtc <<EOT
server s1 {
m4_if($4,,[dnl
        rxreq
        txresp],[$4])
} -start

varnish v1 -vcl+backend {
	import std;
        import $1 from "$abs_top_builddir/src/.libs/libvmod_$1.so";
$2
} -start

client c1 {
$3
} -run
EOT
$VARNISHTEST \
 -Dvarnishd="$VARNISHD"\
 -Dvmod_topsrc=$abs_top_srcdir\
 -Dvmod_topbuild=$abs_top_builddir test.vtc | sed 's/^#.*TEST test.vtc passed.*/OK/'
],
[0],
[OK
])])

# End of testsuite.inc
