]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - tools/testing/selftests/Makefile
Merge remote-tracking branches 'asoc/fix/arizona', 'asoc/fix/cs35l32', 'asoc/fix...
[mirror_ubuntu-bionic-kernel.git] / tools / testing / selftests / Makefile
CommitLineData
66a01b96 1TARGETS = breakpoints
f4ecb322 2TARGETS += capabilities
58c7be84
PE
3TARGETS += cpu-hotplug
4TARGETS += efivarfs
96e869d8
AM
5TARGETS += exec
6TARGETS += firmware
7TARGETS += ftrace
ecac1a75 8TARGETS += futex
7e722473 9TARGETS += ipc
66a01b96 10TARGETS += kcmp
317dc34a 11TARGETS += lib
b6d97344 12TARGETS += membarrier
4f5ce5e8 13TARGETS += memfd
58c7be84 14TARGETS += memory-hotplug
db181ce0 15TARGETS += mount
96e869d8 16TARGETS += mqueue
a6f68034 17TARGETS += net
96e869d8 18TARGETS += powerpc
cc04a46f 19TARGETS += pstore
17afab1d 20TARGETS += ptrace
c99ee51a 21TARGETS += seccomp
96e869d8 22TARGETS += size
1087d019 23TARGETS += static_keys
96e869d8 24TARGETS += sysctl
2278e5ed 25ifneq (1, $(quicktest))
0bc4b0cf 26TARGETS += timers
2278e5ed 27endif
3e2a4c18 28TARGETS += user
96e869d8 29TARGETS += vm
3f705dfd 30TARGETS += x86
f21fb798 31TARGETS += zram
96e869d8 32#Please keep the TARGETS list alphabetically sorted
2278e5ed
SK
33# Run "make quicktest=1 run_tests" or
34# "make quicktest=1 kselftest from top level Makefile
274343ad 35
ddddda9b
SK
36TARGETS_HOTPLUG = cpu-hotplug
37TARGETS_HOTPLUG += memory-hotplug
38
67d8712d
SK
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.
42ifeq (1,$(MAKELEVEL))
60df4642 43override LDFLAGS =
67d8712d
SK
44override MAKEFLAGS =
45endif
46
274343ad
FW
47all:
48 for TARGET in $(TARGETS); do \
49 make -C $$TARGET; \
50 done;
51
cab6b056 52run_tests: all
f467f714
FW
53 for TARGET in $(TARGETS); do \
54 make -C $$TARGET run_tests; \
55 done;
56
ddddda9b
SK
57hotplug:
58 for TARGET in $(TARGETS_HOTPLUG); do \
59 make -C $$TARGET; \
60 done;
61
62run_hotplug: hotplug
63 for TARGET in $(TARGETS_HOTPLUG); do \
64 make -C $$TARGET run_full_test; \
65 done;
66
67clean_hotplug:
68 for TARGET in $(TARGETS_HOTPLUG); do \
69 make -C $$TARGET clean; \
70 done;
71
f615e2bb
HT
72run_pstore_crash:
73 make -C pstore run_crash
74
32dcfba6
ME
75INSTALL_PATH ?= install
76INSTALL_PATH := $(abspath $(INSTALL_PATH))
77ALL_SCRIPT := $(INSTALL_PATH)/run_kselftest.sh
78
79install:
80ifdef INSTALL_PATH
81 @# Ask all targets to install their files
82 mkdir -p $(INSTALL_PATH)
83 for TARGET in $(TARGETS); do \
32dcfba6
ME
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)
101else
102 $(error Error: set INSTALL_PATH to use install)
103endif
104
274343ad
FW
105clean:
106 for TARGET in $(TARGETS); do \
107 make -C $$TARGET clean; \
108 done;
32dcfba6
ME
109
110.PHONY: install