summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/Makefile
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-04-13 17:59:21 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-13 17:59:21 +0200
commit4541fec3104bef0c60633f9e180be94ea5ccc2b7 (patch)
tree8a2bb66c4510bf122ca414de22af0a6f98bc36ab /tools/testing/selftests/Makefile
parentLinux 4.0 (diff)
parentftracetest: Do not use usleep directly (diff)
downloadlinux-4541fec3104bef0c60633f9e180be94ea5ccc2b7.tar.xz
linux-4541fec3104bef0c60633f9e180be94ea5ccc2b7.zip
Merge tag 'linux-kselftest-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
Pull kselftest updates from Shuah Khan: "This is a milestone update in a sense. Several new tests and install and packaging support is added in this update. This update adds install and packaging tools developed on top of back-end shared logic enhancemnets to run and install tests. In addition several timer tests are added. - New timer tests from John Stultz - rtc test from Prarit Bhargava - Enhancements to un and install tests from Michael Ellerman - Install and packaging tools from Shuah Khan - Cross-compilation enablement from Tyler Baker - A couple of bug fixes" * tag 'linux-kselftest-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (42 commits) ftracetest: Do not use usleep directly selftest/mqueue: enable cross compilation selftest/ipc: enable cross compilation selftest/memfd: include default header install path selftest/mount: enable cross compilation selftest/memfd: enable cross compilation kselftests: timers: Make set-timer-lat fail more gracefully for !CAP_WAKE_ALARM selftests: Change memory on-off-test.sh name to be unique selftests: change cpu on-off-test.sh name to be unique selftests/mount: Make git ignore all binaries in mount test suite kselftests: timers: Reduce default runtime on inconsistency-check and set-timer-lat ftracetest: Convert exit -1 to exit $FAIL ftracetest: Cope properly with stack tracer not being enabled tools, update rtctest.c to verify passage of time Documentation, split up rtc.txt into documentation and test file selftests: Add tool to generate kselftest tar archive selftests: Add kselftest install tool selftests: Set CC using CROSS_COMPILE once in lib.mk selftests: Add install support for the powerpc tests selftests/timers: Use shared logic to run and install tests ...
Diffstat (limited to 'tools/testing/selftests/Makefile')
-rw-r--r--tools/testing/selftests/Makefile33
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 0db571340edb..d643d5242537 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -55,7 +55,40 @@ clean_hotplug:
make -C $$TARGET clean; \
done;
+INSTALL_PATH ?= install
+INSTALL_PATH := $(abspath $(INSTALL_PATH))
+ALL_SCRIPT := $(INSTALL_PATH)/run_kselftest.sh
+
+install:
+ifdef INSTALL_PATH
+ @# Ask all targets to install their files
+ mkdir -p $(INSTALL_PATH)
+ for TARGET in $(TARGETS); do \
+ mkdir -p $(INSTALL_PATH)/$$TARGET ; \
+ make -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \
+ done;
+
+ @# Ask all targets to emit their test scripts
+ echo "#!/bin/bash" > $(ALL_SCRIPT)
+ echo "cd \$$(dirname \$$0)" >> $(ALL_SCRIPT)
+ echo "ROOT=\$$PWD" >> $(ALL_SCRIPT)
+
+ for TARGET in $(TARGETS); do \
+ echo "echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \
+ echo "echo ========================================" >> $(ALL_SCRIPT); \
+ echo "cd $$TARGET" >> $(ALL_SCRIPT); \
+ make -s --no-print-directory -C $$TARGET emit_tests >> $(ALL_SCRIPT); \
+ echo "cd \$$ROOT" >> $(ALL_SCRIPT); \
+ done;
+
+ chmod u+x $(ALL_SCRIPT)
+else
+ $(error Error: set INSTALL_PATH to use install)
+endif
+
clean:
for TARGET in $(TARGETS); do \
make -C $$TARGET clean; \
done;
+
+.PHONY: install