From: Peter Feiner <pfeiner@google.com>
To: Shuah Khan <shuahkh@osg.samsung.com>
Cc: linux-api@vger.kernel.org, linux-kernel@vger.kernel.org,
David Herrmann <dh.herrmann@gmail.com>,
Greg Thelen <gthelen@google.com>, Hugh Dickens <hughd@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
Peter Feiner <pfeiner@google.com>
Subject: [PATCH v3 3/3] tools: parallel selftests building & running
Date: Wed, 24 Sep 2014 12:42:11 -0700 [thread overview]
Message-ID: <1411587731-25088-4-git-send-email-pfeiner@google.com> (raw)
In-Reply-To: <1411587731-25088-1-git-send-email-pfeiner@google.com>
Now make -jN builds and runs selftests in parallel. Also, if one
selftest fails to build or run, make will return an error, whereas
before the error was ignored.
Signed-off-by: Peter Feiner <pfeiner@google.com>
---
v1 -> v2:
Moved fix for missing 'make clean' target into separate
patch.
---
tools/testing/selftests/Makefile | 49 ++++++++++++++++------------------------
1 file changed, 20 insertions(+), 29 deletions(-)
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 36ff2e4..8c33716 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -18,32 +18,23 @@ TARGETS += firmware
TARGETS_HOTPLUG = cpu-hotplug
TARGETS_HOTPLUG += memory-hotplug
-all:
- for TARGET in $(TARGETS); do \
- make -C $$TARGET; \
- done;
-
-run_tests: all
- for TARGET in $(TARGETS); do \
- make -C $$TARGET run_tests; \
- done;
-
-hotplug:
- for TARGET in $(TARGETS_HOTPLUG); do \
- make -C $$TARGET; \
- done;
-
-run_hotplug: hotplug
- for TARGET in $(TARGETS_HOTPLUG); do \
- make -C $$TARGET run_full_test; \
- done;
-
-clean_hotplug:
- for TARGET in $(TARGETS_HOTPLUG); do \
- make -C $$TARGET clean; \
- done;
-
-clean:
- for TARGET in $(TARGETS); do \
- make -C $$TARGET clean; \
- done;
+BUILD_TARGETS=$(TARGETS:%=build-%) $(TARGETS_HOTPLUG:%=build-%)
+TEST_TARGETS=$(TARGETS:%=test-%)
+CLEAN_TARGETS=$(TARGETS:%=clean-%) $(TARGETS_HOTPLUG:%=clean-%)
+
+all: $(BUILD_TARGETS)
+
+run_hotplug: test-cpu-hotplug test-memory-hotplug
+
+run_tests: $(TEST_TARGETS)
+
+clean: $(CLEAN_TARGETS)
+
+build-%:
+ $(MAKE) -C $(@:build-%=%)
+
+test-%: build-%
+ $(MAKE) -C $(@:test-%=%) run_tests
+
+clean-%:
+ $(MAKE) -C $(@:clean-%=%) clean
--
2.1.0.rc2.206.gedb03e5
prev parent reply other threads:[~2014-09-24 19:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-23 19:03 [PATCH 0/3] tools: selftests cleanup Peter Feiner
2014-09-23 19:05 ` [PATCH 1/3] tools: add .gitignore entries for selftests Peter Feiner
2014-09-23 19:05 ` [PATCH 2/3] tools: fix warning in memfd_test Peter Feiner
2014-09-23 19:40 ` Shuah Khan
2014-09-23 19:05 ` [PATCH 3/3] tools: parallel selftests building & running Peter Feiner
2014-09-23 19:42 ` Shuah Khan
2014-09-23 19:39 ` [PATCH 1/3] tools: add .gitignore entries for selftests Shuah Khan
2014-09-23 19:55 ` [PATCH v2 0/3] tools: selftests cleanup Peter Feiner
2014-09-23 19:55 ` [PATCH v2 1/3] tools: add .gitignore entries for selftests Peter Feiner
2014-09-23 19:55 ` [PATCH v2 2/3] tools: adding clean target to user selftest Peter Feiner
2014-09-24 17:20 ` Shuah Khan
2014-09-23 19:55 ` [PATCH v2 3/3] tools: parallel selftests building & running Peter Feiner
2014-09-24 19:42 ` [PATCH v2 0/3] tools: selftests cleanup Peter Feiner
2014-09-24 19:42 ` [PATCH v3 1/3] tools: add .gitignore entries for selftests Peter Feiner
2014-09-24 19:42 ` [PATCH v3 2/3] tools: adding clean target to user selftest Peter Feiner
2014-09-24 19:42 ` Peter Feiner [this message]
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=1411587731-25088-4-git-send-email-pfeiner@google.com \
--to=pfeiner@google.com \
--cc=akpm@linux-foundation.org \
--cc=dh.herrmann@gmail.com \
--cc=gthelen@google.com \
--cc=hughd@google.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shuahkh@osg.samsung.com \
/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
Powered by JetHome