[master] bb99710 Let varnishtest know if we use pcre_jit

Poul-Henning Kamp phk at FreeBSD.org
Tue May 5 10:12:39 CEST 2015


commit bb997101a0eb9793348768c76aa5bdc3a345b259
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue May 5 08:12:23 2015 +0000

    Let varnishtest know if we use pcre_jit

diff --git a/bin/varnishtest/tests/r01576.vtc b/bin/varnishtest/tests/r01576.vtc
index 67f5041..5978504 100644
--- a/bin/varnishtest/tests/r01576.vtc
+++ b/bin/varnishtest/tests/r01576.vtc
@@ -1,5 +1,7 @@
 varnishtest "Test certain regex fail before consuming all the stack"
 
+feature pcre_jit
+
 server s1 {
 	rxreq
 	expect req.http.found == "1"
diff --git a/bin/varnishtest/vtc.c b/bin/varnishtest/vtc.c
index 653045f..4b40c90 100644
--- a/bin/varnishtest/vtc.c
+++ b/bin/varnishtest/vtc.c
@@ -47,6 +47,7 @@
 
 #include "vav.h"
 #include "vnum.h"
+#include "vre.h"
 #include "vtim.h"
 
 #define		MAX_TOKENS		200
@@ -598,6 +599,9 @@ cmd_feature(CMD_ARGS)
 		    getgrnam("varnish") != NULL)
 			continue;
 
+		if (!strcmp(av[i], "pcre_jit") && vre__jit)
+			continue;
+
 		vtc_log(vl, 1, "SKIPPING test, missing feature: %s", av[i]);
 		vtc_stop = 1;
 		return;
diff --git a/include/vre.h b/include/vre.h
index a59e8d7..301e806 100644
--- a/include/vre.h
+++ b/include/vre.h
@@ -51,6 +51,8 @@ typedef struct vre vre_t;
 extern const unsigned VRE_CASELESS;
 extern const unsigned VRE_NOTEMPTY;
 
+extern const int vre__jit;
+
 vre_t *VRE_compile(const char *, int, const char **, int *);
 int VRE_exec(const vre_t *code, const char *subject, int length,
     int startoffset, int options, int *ovector, int ovecsize,
diff --git a/lib/libvarnish/vre.c b/lib/libvarnish/vre.c
index 94400fa..0115bad 100644
--- a/lib/libvarnish/vre.c
+++ b/lib/libvarnish/vre.c
@@ -46,6 +46,8 @@
 #  define pcre_free_study pcre_free
 #endif
 
+const int vre__jit = VRE_STUDY_JIT_COMPILE;
+
 struct vre {
 	unsigned		magic;
 #define VRE_MAGIC		0xe83097dc



More information about the varnish-commit mailing list