Andrew Morton | 66a01b9 | 2013-02-27 17:05:56 -0800 | [diff] [blame] | 1 | TARGETS = breakpoints |
Bamvor Jian Zhang | f4ecb32 | 2015-11-17 22:35:42 +0800 | [diff] [blame] | 2 | TARGETS += capabilities |
Andrew Morton | 66a01b9 | 2013-02-27 17:05:56 -0800 | [diff] [blame] | 3 | TARGETS += cpu-hotplug |
Andrew Morton | 66a01b9 | 2013-02-27 17:05:56 -0800 | [diff] [blame] | 4 | TARGETS += efivarfs |
Andrew Morton | 96e869d | 2014-12-18 16:17:43 -0800 | [diff] [blame] | 5 | TARGETS += exec |
| 6 | TARGETS += firmware |
| 7 | TARGETS += ftrace |
Darren Hart | ecac1a7 | 2015-05-12 21:07:55 -0700 | [diff] [blame] | 8 | TARGETS += futex |
Bamvor Jian Zhang | 7e72247 | 2015-11-17 22:35:43 +0800 | [diff] [blame] | 9 | TARGETS += ipc |
Pavel Emelyanov | 58c7be8 | 2013-04-30 15:27:06 -0700 | [diff] [blame] | 10 | TARGETS += kcmp |
Kees Cook | 317dc34 | 2015-11-06 16:30:32 -0800 | [diff] [blame] | 11 | TARGETS += lib |
Pranith Kumar | b6d9734 | 2015-09-11 13:07:42 -0700 | [diff] [blame] | 12 | TARGETS += membarrier |
David Herrmann | 4f5ce5e | 2014-08-08 14:25:32 -0700 | [diff] [blame] | 13 | TARGETS += memfd |
Pavel Emelyanov | 58c7be8 | 2013-04-30 15:27:06 -0700 | [diff] [blame] | 14 | TARGETS += memory-hotplug |
Eric W. Biederman | db181ce | 2014-07-29 15:50:44 -0700 | [diff] [blame] | 15 | TARGETS += mount |
Andrew Morton | 96e869d | 2014-12-18 16:17:43 -0800 | [diff] [blame] | 16 | TARGETS += mqueue |
David S. Miller | a6f6803 | 2013-03-20 15:07:56 -0400 | [diff] [blame] | 17 | TARGETS += net |
Michael Ellerman | 0e56dac | 2013-08-06 17:42:35 +1000 | [diff] [blame] | 18 | TARGETS += powerpc |
Hiraku Toyooka | cc04a46 | 2015-10-02 20:46:39 +0900 | [diff] [blame] | 19 | TARGETS += pstore |
Andrew Morton | 96e869d | 2014-12-18 16:17:43 -0800 | [diff] [blame] | 20 | TARGETS += ptrace |
Kees Cook | c99ee51 | 2015-06-16 10:54:14 -0700 | [diff] [blame] | 21 | TARGETS += seccomp |
Stas Sergeev | 19fd286 | 2016-04-14 23:20:05 +0300 | [diff] [blame] | 22 | TARGETS += sigaltstack |
Tim Bird | 3ce5105 | 2014-12-03 10:42:21 -0800 | [diff] [blame] | 23 | TARGETS += size |
Bamvor Jian Zhang | 1087d01 | 2015-09-09 21:06:25 +0800 | [diff] [blame] | 24 | TARGETS += static_keys |
Andrew Morton | 96e869d | 2014-12-18 16:17:43 -0800 | [diff] [blame] | 25 | TARGETS += sysctl |
Shuah Khan | 2278e5e | 2015-06-19 13:13:43 -0600 | [diff] [blame] | 26 | ifneq (1, $(quicktest)) |
Andrew Morton | 96e869d | 2014-12-18 16:17:43 -0800 | [diff] [blame] | 27 | TARGETS += timers |
Shuah Khan | 2278e5e | 2015-06-19 13:13:43 -0600 | [diff] [blame] | 28 | endif |
Andrew Morton | 96e869d | 2014-12-18 16:17:43 -0800 | [diff] [blame] | 29 | TARGETS += user |
| 30 | TARGETS += vm |
Andy Lutomirski | 3f705df | 2015-04-06 23:11:06 -0700 | [diff] [blame] | 31 | TARGETS += x86 |
Naresh Kamboju | f21fb79 | 2015-08-18 12:31:59 +0530 | [diff] [blame] | 32 | TARGETS += zram |
Andrew Morton | 96e869d | 2014-12-18 16:17:43 -0800 | [diff] [blame] | 33 | #Please keep the TARGETS list alphabetically sorted |
Shuah Khan | 2278e5e | 2015-06-19 13:13:43 -0600 | [diff] [blame] | 34 | # Run "make quicktest=1 run_tests" or |
| 35 | # "make quicktest=1 kselftest from top level Makefile |
Frederic Weisbecker | 274343a | 2012-01-12 17:20:44 -0800 | [diff] [blame] | 36 | |
Shuah Khan | ddddda9 | 2014-07-02 09:51:38 -0600 | [diff] [blame] | 37 | TARGETS_HOTPLUG = cpu-hotplug |
| 38 | TARGETS_HOTPLUG += memory-hotplug |
| 39 | |
Shuah Khan | 67d8712 | 2015-03-18 11:57:39 -0600 | [diff] [blame] | 40 | # Clear LDFLAGS and MAKEFLAGS if called from main |
| 41 | # Makefile to avoid test build failures when test |
| 42 | # Makefile doesn't have explicit build rules. |
| 43 | ifeq (1,$(MAKELEVEL)) |
Arnaldo Carvalho de Melo | 60df464 | 2015-05-14 16:55:18 -0300 | [diff] [blame] | 44 | override LDFLAGS = |
Shuah Khan | 67d8712 | 2015-03-18 11:57:39 -0600 | [diff] [blame] | 45 | override MAKEFLAGS = |
| 46 | endif |
| 47 | |
Frederic Weisbecker | 274343a | 2012-01-12 17:20:44 -0800 | [diff] [blame] | 48 | all: |
| 49 | for TARGET in $(TARGETS); do \ |
| 50 | make -C $$TARGET; \ |
| 51 | done; |
| 52 | |
Andrew Morton | cab6b05 | 2012-03-28 14:42:54 -0700 | [diff] [blame] | 53 | run_tests: all |
Frederic Weisbecker | f467f71 | 2012-03-28 14:42:54 -0700 | [diff] [blame] | 54 | for TARGET in $(TARGETS); do \ |
| 55 | make -C $$TARGET run_tests; \ |
| 56 | done; |
| 57 | |
Shuah Khan | ddddda9 | 2014-07-02 09:51:38 -0600 | [diff] [blame] | 58 | hotplug: |
| 59 | for TARGET in $(TARGETS_HOTPLUG); do \ |
| 60 | make -C $$TARGET; \ |
| 61 | done; |
| 62 | |
| 63 | run_hotplug: hotplug |
| 64 | for TARGET in $(TARGETS_HOTPLUG); do \ |
| 65 | make -C $$TARGET run_full_test; \ |
| 66 | done; |
| 67 | |
| 68 | clean_hotplug: |
| 69 | for TARGET in $(TARGETS_HOTPLUG); do \ |
| 70 | make -C $$TARGET clean; \ |
| 71 | done; |
| 72 | |
Hiraku Toyooka | f615e2b | 2015-10-02 20:46:41 +0900 | [diff] [blame] | 73 | run_pstore_crash: |
| 74 | make -C pstore run_crash |
| 75 | |
Michael Ellerman | 32dcfba | 2015-03-11 15:06:00 +1100 | [diff] [blame] | 76 | INSTALL_PATH ?= install |
| 77 | INSTALL_PATH := $(abspath $(INSTALL_PATH)) |
| 78 | ALL_SCRIPT := $(INSTALL_PATH)/run_kselftest.sh |
| 79 | |
| 80 | install: |
| 81 | ifdef INSTALL_PATH |
| 82 | @# Ask all targets to install their files |
| 83 | mkdir -p $(INSTALL_PATH) |
| 84 | for TARGET in $(TARGETS); do \ |
Michael Ellerman | 32dcfba | 2015-03-11 15:06:00 +1100 | [diff] [blame] | 85 | make -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \ |
| 86 | done; |
| 87 | |
| 88 | @# Ask all targets to emit their test scripts |
| 89 | echo "#!/bin/bash" > $(ALL_SCRIPT) |
| 90 | echo "cd \$$(dirname \$$0)" >> $(ALL_SCRIPT) |
| 91 | echo "ROOT=\$$PWD" >> $(ALL_SCRIPT) |
| 92 | |
| 93 | for TARGET in $(TARGETS); do \ |
| 94 | echo "echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \ |
| 95 | echo "echo ========================================" >> $(ALL_SCRIPT); \ |
| 96 | echo "cd $$TARGET" >> $(ALL_SCRIPT); \ |
| 97 | make -s --no-print-directory -C $$TARGET emit_tests >> $(ALL_SCRIPT); \ |
| 98 | echo "cd \$$ROOT" >> $(ALL_SCRIPT); \ |
| 99 | done; |
| 100 | |
| 101 | chmod u+x $(ALL_SCRIPT) |
| 102 | else |
| 103 | $(error Error: set INSTALL_PATH to use install) |
| 104 | endif |
| 105 | |
Frederic Weisbecker | 274343a | 2012-01-12 17:20:44 -0800 | [diff] [blame] | 106 | clean: |
| 107 | for TARGET in $(TARGETS); do \ |
| 108 | make -C $$TARGET clean; \ |
| 109 | done; |
Michael Ellerman | 32dcfba | 2015-03-11 15:06:00 +1100 | [diff] [blame] | 110 | |
| 111 | .PHONY: install |