selftests/futex: Update Makefile to use lib.mk
authorDarren Hart <dvhart@linux.intel.com>
Wed, 13 May 2015 04:07:53 +0000 (21:07 -0700)
committerShuah Khan <shuahkh@osg.samsung.com>
Tue, 26 May 2015 21:58:08 +0000 (15:58 -0600)
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 <shuahkh@osg.samsung.com>
Cc: linux-api@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
tools/testing/selftests/futex/Makefile
tools/testing/selftests/futex/functional/Makefile

index 2c26d59aaaeeaba664e301d2602c43c87af3d4f7..6a1752956283cbef8f70ae83c103fa73a1dae4ab 100644 (file)
@@ -1,11 +1,29 @@
 SUBDIRS := functional
 
+TEST_PROGS := run.sh
+
 .PHONY: all clean
 all:
        for DIR in $(SUBDIRS); do $(MAKE) -C $$DIR $@ ; done
 
-run_tests: all
+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
index 720023e21781d6ee74143218b3fa2f4fba9cc8f7..4b018febf9f13f39285d206d897b0cee4d8911b9 100644 (file)
@@ -12,13 +12,14 @@ TARGETS := \
        futex_wait_uninitialized_heap \
        futex_wait_private_mapped_file
 
+TEST_PROGS := $(TARGETS) run.sh
+
 .PHONY: all clean
 all: $(TARGETS)
 
 $(TARGETS): $(HEADERS)
 
-run_tests: all
-       ./run.sh
+include ../../lib.mk
 
 clean:
        rm -f $(TARGETS)