]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - tools/testing/selftests/Makefile
selftest: sync: improve assert() failure message
[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
6ad92bf6 18TARGETS += nsfs
96e869d8 19TARGETS += powerpc
cc04a46f 20TARGETS += pstore
17afab1d 21TARGETS += ptrace
c99ee51a 22TARGETS += seccomp
19fd2868 23TARGETS += sigaltstack
96e869d8 24TARGETS += size
1087d019 25TARGETS += static_keys
82208160 26TARGETS += sync
96e869d8 27TARGETS += sysctl
2278e5ed 28ifneq (1, $(quicktest))
0bc4b0cf 29TARGETS += timers
2278e5ed 30endif
3e2a4c18 31TARGETS += user
96e869d8 32TARGETS += vm
3f705dfd 33TARGETS += x86
f21fb798 34TARGETS += zram
96e869d8 35#Please keep the TARGETS list alphabetically sorted
2278e5ed
SK
36# Run "make quicktest=1 run_tests" or
37# "make quicktest=1 kselftest from top level Makefile
274343ad 38
ddddda9b
SK
39TARGETS_HOTPLUG = cpu-hotplug
40TARGETS_HOTPLUG += memory-hotplug
41
67d8712d
SK
42# Clear LDFLAGS and MAKEFLAGS if called from main
43# Makefile to avoid test build failures when test
44# Makefile doesn't have explicit build rules.
45ifeq (1,$(MAKELEVEL))
60df4642 46override LDFLAGS =
67d8712d
SK
47override MAKEFLAGS =
48endif
49
274343ad
FW
50all:
51 for TARGET in $(TARGETS); do \
52 make -C $$TARGET; \
53 done;
54
cab6b056 55run_tests: all
f467f714
FW
56 for TARGET in $(TARGETS); do \
57 make -C $$TARGET run_tests; \
58 done;
59
ddddda9b
SK
60hotplug:
61 for TARGET in $(TARGETS_HOTPLUG); do \
62 make -C $$TARGET; \
63 done;
64
65run_hotplug: hotplug
66 for TARGET in $(TARGETS_HOTPLUG); do \
67 make -C $$TARGET run_full_test; \
68 done;
69
70clean_hotplug:
71 for TARGET in $(TARGETS_HOTPLUG); do \
72 make -C $$TARGET clean; \
73 done;
74
f615e2bb
HT
75run_pstore_crash:
76 make -C pstore run_crash
77
32dcfba6
ME
78INSTALL_PATH ?= install
79INSTALL_PATH := $(abspath $(INSTALL_PATH))
80ALL_SCRIPT := $(INSTALL_PATH)/run_kselftest.sh
81
82install:
83ifdef INSTALL_PATH
84 @# Ask all targets to install their files
85 mkdir -p $(INSTALL_PATH)
86 for TARGET in $(TARGETS); do \
32dcfba6
ME
87 make -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \
88 done;
89
90 @# Ask all targets to emit their test scripts
91 echo "#!/bin/bash" > $(ALL_SCRIPT)
92 echo "cd \$$(dirname \$$0)" >> $(ALL_SCRIPT)
93 echo "ROOT=\$$PWD" >> $(ALL_SCRIPT)
94
95 for TARGET in $(TARGETS); do \
96 echo "echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \
97 echo "echo ========================================" >> $(ALL_SCRIPT); \
98 echo "cd $$TARGET" >> $(ALL_SCRIPT); \
99 make -s --no-print-directory -C $$TARGET emit_tests >> $(ALL_SCRIPT); \
100 echo "cd \$$ROOT" >> $(ALL_SCRIPT); \
101 done;
102
103 chmod u+x $(ALL_SCRIPT)
104else
105 $(error Error: set INSTALL_PATH to use install)
106endif
107
274343ad
FW
108clean:
109 for TARGET in $(TARGETS); do \
110 make -C $$TARGET clean; \
111 done;
32dcfba6
ME
112
113.PHONY: install