tests: Allow to run tests recursively
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>
This commit is contained in:
parent
8d391512b7
commit
14f8854fa3
|
|
@ -4,7 +4,11 @@ PREFIX := sudo -E
|
||||||
RESULTS_DIR := results
|
RESULTS_DIR := results
|
||||||
## -- End Config --
|
## -- 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/*))
|
IPVERS := $(filter-out iproute2/Makefile,$(wildcard iproute2/*))
|
||||||
|
|
||||||
ifneq (,$(wildcard /proc/config.gz))
|
ifneq (,$(wildcard /proc/config.gz))
|
||||||
|
|
@ -34,6 +38,11 @@ distclean: clean
|
||||||
|
|
||||||
$(TESTS):
|
$(TESTS):
|
||||||
@mkdir -p $(RESULTS_DIR)
|
@mkdir -p $(RESULTS_DIR)
|
||||||
|
|
||||||
|
@for d in $(TESTS_DIR); do \
|
||||||
|
mkdir -p $(RESULTS_DIR)/$$d; \
|
||||||
|
done
|
||||||
|
|
||||||
@for i in $(IPVERS); do \
|
@for i in $(IPVERS); do \
|
||||||
o=`echo $$i | sed -e 's/iproute2\///'`; \
|
o=`echo $$i | sed -e 's/iproute2\///'`; \
|
||||||
echo -n "Running $@ [$$o/`uname -r`]: "; \
|
echo -n "Running $@ [$$o/`uname -r`]: "; \
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ fi
|
||||||
for q in ${QDISCS}; do
|
for q in ${QDISCS}; do
|
||||||
ts_log "Preparing classifier testbed with qdisc $q"
|
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
|
case "$q" in
|
||||||
cbq)
|
cbq)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue