xref: /openbmc/linux/tools/testing/selftests/timers/Makefile (revision 475c57cce34a12641d10f6653556023d17913039)
1CFLAGS += -O3 -Wl,-no-as-needed -Wall
2LDFLAGS += -lrt -lpthread -lm
3
4# these are all "safe" tests that don't modify
5# system time or require escalated privileges
6TEST_GEN_PROGS = posix_timers nanosleep nsleep-lat set-timer-lat mqueue-lat \
7	     inconsistency-check raw_skew threadtest rtctest
8
9DESTRUCTIVE_TESTS = alarmtimer-suspend valid-adjtimex adjtick change_skew \
10		      skew_consistency clocksource-switch freq-step leap-a-day \
11		      leapcrash set-tai set-2038 set-tz
12
13TEST_GEN_PROGS_EXTENDED = $(DESTRUCTIVE_TESTS) rtctest_setdate
14
15
16include ../lib.mk
17
18define RUN_DESTRUCTIVE_TESTS
19	@for TEST in $(DESTRUCTIVE_TESTS); do \
20		BASENAME_TEST=`basename $$TEST`;	\
21		if [ ! -x $$BASENAME_TEST ]; then	\
22			echo "selftests: Warning: file $$BASENAME_TEST is not executable, correct this.";\
23			echo "selftests: $$BASENAME_TEST [FAIL]"; \
24		else					\
25			cd `dirname $$TEST`; (./$$BASENAME_TEST && echo "selftests: $$BASENAME_TEST [PASS]") || echo "selftests:  $$BASENAME_TEST [FAIL]"; cd -;\
26		fi;					\
27	done;
28endef
29
30# these tests require escalated privileges
31# and may modify the system time or trigger
32# other behavior like suspend
33run_destructive_tests: run_tests
34	$(RUN_DESTRUCTIVE_TESTS)
35