From 26ac8a6c4ed47dbf5d773d59ef09880eaabec8ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Mon, 25 Jun 2018 11:15:43 +0200 Subject: [PATCH] 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. --- Makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9ea3e80ce..817161f76 100644 --- a/Makefile +++ b/Makefile @@ -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