]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - tools/testing/selftests/Makefile
Merge tag 'configfs-for-linus-2' of git://git.infradead.org/users/hch/configfs
[mirror_ubuntu-bionic-kernel.git] / tools / testing / selftests / Makefile
1 TARGETS = breakpoints
2 TARGETS += capabilities
3 TARGETS += cpu-hotplug
4 TARGETS += efivarfs
5 TARGETS += exec
6 TARGETS += firmware
7 TARGETS += ftrace
8 TARGETS += futex
9 TARGETS += ipc
10 TARGETS += kcmp
11 TARGETS += lib
12 TARGETS += membarrier
13 TARGETS += memfd
14 TARGETS += memory-hotplug
15 TARGETS += mount
16 TARGETS += mqueue
17 TARGETS += net
18 TARGETS += powerpc
19 TARGETS += pstore
20 TARGETS += ptrace
21 TARGETS += seccomp
22 TARGETS += size
23 TARGETS += static_keys
24 TARGETS += sysctl
25 ifneq (1, $(quicktest))
26 TARGETS += timers
27 endif
28 TARGETS += user
29 TARGETS += vm
30 TARGETS += x86
31 TARGETS += zram
32 #Please keep the TARGETS list alphabetically sorted
33 # Run "make quicktest=1 run_tests" or
34 # "make quicktest=1 kselftest from top level Makefile
35
36 TARGETS_HOTPLUG = cpu-hotplug
37 TARGETS_HOTPLUG += memory-hotplug
38
39 # Clear LDFLAGS and MAKEFLAGS if called from main
40 # Makefile to avoid test build failures when test
41 # Makefile doesn't have explicit build rules.
42 ifeq (1,$(MAKELEVEL))
43 override LDFLAGS =
44 override MAKEFLAGS =
45 endif
46
47 all:
48 for TARGET in $(TARGETS); do \
49 make -C $$TARGET; \
50 done;
51
52 run_tests: all
53 for TARGET in $(TARGETS); do \
54 make -C $$TARGET run_tests; \
55 done;
56
57 hotplug:
58 for TARGET in $(TARGETS_HOTPLUG); do \
59 make -C $$TARGET; \
60 done;
61
62 run_hotplug: hotplug
63 for TARGET in $(TARGETS_HOTPLUG); do \
64 make -C $$TARGET run_full_test; \
65 done;
66
67 clean_hotplug:
68 for TARGET in $(TARGETS_HOTPLUG); do \
69 make -C $$TARGET clean; \
70 done;
71
72 run_pstore_crash:
73 make -C pstore run_crash
74
75 INSTALL_PATH ?= install
76 INSTALL_PATH := $(abspath $(INSTALL_PATH))
77 ALL_SCRIPT := $(INSTALL_PATH)/run_kselftest.sh
78
79 install:
80 ifdef INSTALL_PATH
81 @# Ask all targets to install their files
82 mkdir -p $(INSTALL_PATH)
83 for TARGET in $(TARGETS); do \
84 make -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \
85 done;
86
87 @# Ask all targets to emit their test scripts
88 echo "#!/bin/bash" > $(ALL_SCRIPT)
89 echo "cd \$$(dirname \$$0)" >> $(ALL_SCRIPT)
90 echo "ROOT=\$$PWD" >> $(ALL_SCRIPT)
91
92 for TARGET in $(TARGETS); do \
93 echo "echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \
94 echo "echo ========================================" >> $(ALL_SCRIPT); \
95 echo "cd $$TARGET" >> $(ALL_SCRIPT); \
96 make -s --no-print-directory -C $$TARGET emit_tests >> $(ALL_SCRIPT); \
97 echo "cd \$$ROOT" >> $(ALL_SCRIPT); \
98 done;
99
100 chmod u+x $(ALL_SCRIPT)
101 else
102 $(error Error: set INSTALL_PATH to use install)
103 endif
104
105 clean:
106 for TARGET in $(TARGETS); do \
107 make -C $$TARGET clean; \
108 done;
109
110 .PHONY: install