REGTEST/MINOR: Add levels to reg-tests target.

With this patch we can provide LEVEL environment variable when
running reg-tests Makefile targe (reg testing) to set the execution
level of the reg-tests make target to run.

LEVEL default value is 1.

LEVEL=1 is to run all h*.vtc files which are the most important
reg testing files (to test haproxy core, HTTP compliance etc).

LEVEL=2 is to run all s*.vtc files which are a bit slow tests,
for instance tests requiring external programs (curl, socat etc).

LEVEL=3 is to run all l*.vtc files which are test files with again
more slow or with little interest.
This commit is contained in:
Frdric Lcaille 2018-06-25 11:15:43 +02:00 committed by Willy Tarreau
parent bca3a980e9
commit 26ac8a6c4e
1 changed files with 12 additions and 2 deletions

View File

@ -1004,6 +1004,16 @@ reg-tests:
echo "Please make the VARNISHTEST_PROGRAM variable point to the location of the varnishtest program."; \
exit 1; \
fi
@find reg-tests -type f -name "*.vtc" -print0 | \
HAPROXY_PROGRAM=$${HAPROXY_PROGRAM:-$$PWD/haproxy} xargs -0 $(VARNISHTEST_PROGRAM) -l -t5
@export LEVEL=$${LEVEL:-1}; \
if [ $$LEVEL = 1 ] ; then \
EXPR='h*.vtc'; \
elif [ $$LEVEL = 2 ] ; then \
EXPR='s*.vtc'; \
elif [ $$LEVEL = 3 ] ; then \
EXPR='l*.vtc'; \
fi ; \
if [ -n "$$EXPR" ] ; then \
find reg-tests -type f -name "$$EXPR" -print0 | \
HAPROXY_PROGRAM=$${HAPROXY_PROGRAM:-$$PWD/haproxy} xargs -r -0 $(VARNISHTEST_PROGRAM) -l -t5 ; \
fi
.PHONY: reg-tests