]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tests: Allow to run tests recursively
authorvadimk <vadim4j@gmail.com>
Fri, 10 Oct 2014 06:27:19 +0000 (09:27 +0300)
committerStephen Hemminger <shemming@brocade.com>
Thu, 30 Oct 2014 05:26:59 +0000 (22:26 -0700)
Such approach allows to run *.t scripts from any
tests/ subdirectories.

One point is that tests from tests/cls/*.t (which are needed
by tests/cls-testbed.t but does not exist yet) will also
be ran aside with tests/cls-testbed.t which is not good
because in such case they will be ran twice, so renamed these
tests path to tests/cls/*.c in tests/cls-testbed.t

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
testsuite/Makefile
testsuite/tests/cls-testbed.t

index d1bf359ab1beed79897ab67c59e848946ff52582..2ba954737c05d649dea5d11dca9e00521b90925b 100644 (file)
@@ -4,7 +4,11 @@ PREFIX := sudo -E
 RESULTS_DIR := results
 ## -- End Config --
 
-TESTS := $(patsubst tests/%,%,$(wildcard tests/*.t))
+rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
+
+TESTS := $(patsubst tests/%,%,$(call rwildcard,tests/,*.t))
+TESTS_DIR := $(dir $(TESTS))
+
 IPVERS := $(filter-out iproute2/Makefile,$(wildcard iproute2/*))
 
 ifneq (,$(wildcard /proc/config.gz))
@@ -34,6 +38,11 @@ distclean: clean
 
 $(TESTS):
        @mkdir -p $(RESULTS_DIR)
+       
+       @for d in $(TESTS_DIR); do \
+           mkdir -p $(RESULTS_DIR)/$$d; \
+       done
+       
        @for i in $(IPVERS); do \
                o=`echo $$i | sed -e 's/iproute2\///'`; \
                echo -n "Running $@ [$$o/`uname -r`]: "; \
index f5f997942838fdac019524d74e0749b53f0ffe41..2afc26fc992c0b2c225e6deb2a57b293dd77f37f 100755 (executable)
@@ -13,7 +13,7 @@ fi
 for q in ${QDISCS}; do
        ts_log "Preparing classifier testbed with qdisc $q"
 
-       for c in tests/cls/*.t; do
+       for c in tests/cls/*.c; do
 
                case "$q" in
                cbq)