Netdev List
 help / color / mirror / Atom feed
From: Vadim Kochan <vadim4j@gmail.com>
To: netdev@vger.kernel.org
Cc: Vadim Kochan <vadim4j@gmail.com>
Subject: [PATCH iproute2] tests: Allow to run tests recursively
Date: Fri, 10 Oct 2014 09:27:19 +0300	[thread overview]
Message-ID: <1412922439-28953-1-git-send-email-vadim4j@gmail.com> (raw)

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            | 11 ++++++++++-
 testsuite/tests/cls-testbed.t |  2 +-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/testsuite/Makefile b/testsuite/Makefile
index d1bf359..2ba9547 100644
--- a/testsuite/Makefile
+++ b/testsuite/Makefile
@@ -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`]: "; \
diff --git a/testsuite/tests/cls-testbed.t b/testsuite/tests/cls-testbed.t
index efae2a5..9fe86f5 100755
--- a/testsuite/tests/cls-testbed.t
+++ b/testsuite/tests/cls-testbed.t
@@ -8,7 +8,7 @@ QDISCS="cbq htb dsmark"
 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)
-- 
2.1.0

                 reply	other threads:[~2014-10-10  6:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1412922439-28953-1-git-send-email-vadim4j@gmail.com \
    --to=vadim4j@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox