summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorShuah Khan <shuahkh@osg.samsung.com>2017-08-17 16:34:43 -0600
committerShuah Khan <shuahkh@osg.samsung.com>2017-08-22 11:38:28 -0600
commitdf9c011c0a23cf1399c01f896cd359d932ab49b5 (patch)
treed2e093daf6c36a815766cbc543bb2c8784056965 /tools
parent98b74e1f31045a63f6148b2d129ca9bf244e24ab (diff)
downloadlinux-df9c011c0a23cf1399c01f896cd359d932ab49b5.tar.gz
linux-df9c011c0a23cf1399c01f896cd359d932ab49b5.tar.bz2
linux-df9c011c0a23cf1399c01f896cd359d932ab49b5.zip
selftests: timers: Fix run_destructive_tests target to handle skipped tests
When a test exits with skip exit code of 4, "make run_destructive_tests" halts testing. Fix run_destructive_tests target to handle error exit codes. Cc: stable <stable@vger.kernel.org> [4.13+] Reported-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/timers/Makefile26
1 files changed, 13 insertions, 13 deletions
diff --git a/tools/testing/selftests/timers/Makefile b/tools/testing/selftests/timers/Makefile
index c805ab048d26..6c1327278d5f 100644
--- a/tools/testing/selftests/timers/Makefile
+++ b/tools/testing/selftests/timers/Makefile
@@ -13,20 +13,20 @@ TEST_GEN_PROGS_EXTENDED = alarmtimer-suspend valid-adjtimex adjtick change_skew
include ../lib.mk
+define RUN_DESTRUCTIVE_TESTS
+ @for TEST in $(TEST_GEN_PROGS_EXTENDED); do \
+ BASENAME_TEST=`basename $$TEST`; \
+ if [ ! -x $$BASENAME_TEST ]; then \
+ echo "selftests: Warning: file $$BASENAME_TEST is not executable, correct this.";\
+ echo "selftests: $$BASENAME_TEST [FAIL]"; \
+ else \
+ cd `dirname $$TEST`; (./$$BASENAME_TEST && echo "selftests: $$BASENAME_TEST [PASS]") || echo "selftests: $$BASENAME_TEST [FAIL]"; cd -;\
+ fi; \
+ done;
+endef
+
# these tests require escalated privileges
# and may modify the system time or trigger
# other behavior like suspend
run_destructive_tests: run_tests
- ./alarmtimer-suspend
- ./valid-adjtimex
- ./adjtick
- ./change_skew
- ./skew_consistency
- ./clocksource-switch
- ./freq-step
- ./leap-a-day -s -i 10
- ./leapcrash
- ./set-tz
- ./set-tai
- ./set-2038
-
+ $(RUN_DESTRUCTIVE_TESTS)