]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REGTEST: add the option to test only a specific set of files
authorWilly Tarreau <w@1wt.eu>
Fri, 23 Nov 2018 07:29:15 +0000 (08:29 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 23 Nov 2018 07:34:03 +0000 (08:34 +0100)
It currently is quite difficult to re-reun a specific test after an
error occurs. This patch adds a REG_TEST_FILES variable to the makefile,
which will be used to override the find operation. This helps focusing
on a specific file, which is essential during bisect to figure what
commit introduced a specific regression. Multiple files may be tested,
the return code will indicate the number of failed tests.

Makefile

index 73f7dd40a2ff84b930ad5966b4f3ff29be9ed5ba..6d7a01598d18edc90be1683f95a6140564f28a50 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -164,6 +164,9 @@ DEBUG_CFLAGS = -g
 #### Add -Werror when set to non-empty
 ERR =
 
+#### May be used to force running a specific set of reg-tests
+REG_TEST_FILES =
+
 #### Compiler-specific flags that may be used to disable some negative over-
 # optimization or to silence some warnings. -fno-strict-aliasing is needed with
 # gcc >= 4.4.
@@ -1105,7 +1108,13 @@ reg-tests:
        elif [ $$LEVEL = 4 ] ; then \
           EXPR='b*.vtc'; \
        fi ; \
-       if [ -n "$$EXPR" ] ; then \
+       if [ -n "$(REG_TEST_FILES)" ] ; then \
+          err=0; \
+          for n in $(REG_TEST_FILES); do \
+             HAPROXY_PROGRAM=$${HAPROXY_PROGRAM:-$$PWD/haproxy} $(VARNISHTEST_PROGRAM) -l -t5 $$n || ((err++)); \
+          done; \
+          exit $$err; \
+       elif [ -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