REGTEST/MINOR: script: add run-regtests.sh script
Some tests require a minimal haproxy version or compilation options to be
able to run successfully. This script allows to add 'requirements' to tests
to check so they will automatically be skipped if a requirement is not met.
The script supports several parameters to slightly modify its behavior
including the directories to search for tests.
Also some features are not available for certain OS's these can also
be 'excluded', this should allow for the complete set of test cases to be
run on any OS against any haproxy release without 'expected failures'.
The test .vtc files will need to be modified to include their 'requirements'
by listing including text options as shown below:
#EXCLUDE_TARGETS=dos,freebsd,windows
#REQUIRE_OPTIONS=ZLIB,OPENSSL,LUA
#REQUIRE_VERSION=0.0
#REQUIRE_VERSION_BELOW=99.9,
When excluding a OS by its TARGET, please do make a comment why the test
can not succeed on that TARGET.
diff --git a/Makefile b/Makefile
index f28ed58..141a6e6 100644
--- a/Makefile
+++ b/Makefile
@@ -1095,28 +1095,5 @@
# LEVEL 3 scripts are low interest scripts (prefixed with 'l' letter).
# LEVEL 4 scripts are in relation with bugs they help to reproduce (prefixed with 'b' letter).
reg-tests:
- $(Q)if [ ! -x "$(VARNISHTEST_PROGRAM)" ]; then \
- echo "Please make the VARNISHTEST_PROGRAM variable point to the location of the varnishtest program."; \
- exit 1; \
- fi
- $(Q)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'; \
- elif [ $$LEVEL = 4 ] ; then \
- EXPR='b*.vtc'; \
- fi ; \
- 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
+ ./scripts/run-regtests.sh --LEVEL "$$LEVEL" $(REG_TEST_FILES)
.PHONY: reg-tests