[PATCH 2/5] selftest/futex: Update Makefile to use lib.mk
From: Darren Hart <hidden>
Date: 2015-03-27 22:17:57
Also in:
lkml
Subsystem:
futex subsystem, kernel selftest framework, the rest · Maintainers:
Thomas Gleixner, Ingo Molnar, Shuah Khan, Shuah Khan, Linus Torvalds
Adapt the futextest Makefiles to use lib.mk macros for RUN_TESTS and EMIT_TESTS. For now, we reuse the run.sh mechanism provided by futextest. This doesn't provide the standard selftests: [PASS|FAIL] format, but the tests provide very similar output already. This results in the run_kselftest.sh script for futexes including a single line: ./run.sh Cc: Shuah Khan <redacted> Cc: linux-api@vger.kernel.org Cc: Ingo Molnar <redacted> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <redacted> Cc: Davidlohr Bueso <dave@stgolabs.net> Cc: KOSAKI Motohiro <redacted> Signed-off-by: Darren Hart <redacted> --- tools/testing/selftests/futex/Makefile | 21 +++++++++++++++++++++ tools/testing/selftests/futex/functional/Makefile | 4 ++++ 2 files changed, 25 insertions(+)
diff --git a/tools/testing/selftests/futex/Makefile b/tools/testing/selftests/futex/Makefile
index 8629187..6a17529 100644
--- a/tools/testing/selftests/futex/Makefile
+++ b/tools/testing/selftests/futex/Makefile@@ -1,8 +1,29 @@ SUBDIRS := functional +TEST_PROGS := run.sh + .PHONY: all clean all: for DIR in $(SUBDIRS); do $(MAKE) -C $$DIR $@ ; done +include ../lib.mk + +override define RUN_TESTS + ./run.sh +endef + +override define INSTALL_RULE + mkdir -p $(INSTALL_PATH) + install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) + + @for SUBDIR in $(SUBDIRS); do \ + $(MAKE) -C $$SUBDIR INSTALL_PATH=$(INSTALL_PATH)/$$SUBDIR install; \ + done; +endef + +override define EMIT_TESTS + echo "./run.sh" +endef + clean: for DIR in $(SUBDIRS); do $(MAKE) -C $$DIR $@ ; done
diff --git a/tools/testing/selftests/futex/functional/Makefile b/tools/testing/selftests/futex/functional/Makefile
index 6ecb42c..fb96927 100644
--- a/tools/testing/selftests/futex/functional/Makefile
+++ b/tools/testing/selftests/futex/functional/Makefile@@ -12,10 +12,14 @@ TARGETS := \ futex_wait_uninitialized_heap \ futex_wait_private_mapped_file +TEST_PROGS := $(TARGETS) run.sh + .PHONY: all clean all: $(TARGETS) $(TARGETS): $(HEADERS) +include ../../lib.mk + clean: rm -f $(TARGETS)
--
2.1.4