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