]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REGTEST/MINOR: Add levels to reg-tests target.
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 25 Jun 2018 09:15:43 +0000 (11:15 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 25 Jun 2018 20:04:58 +0000 (22:04 +0200)
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

index 9ea3e80ce3f7b3efb9ea0758ba09777620327395..817161f76a4cc500d7e4c35c4da167963fd39795 100644 (file)
--- 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