Skip to content

Commit df9c011

Browse files
author
Shuah Khan
committed
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 <[email protected]> [4.13+] Reported-by: John Stultz <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent 98b74e1 commit df9c011

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

tools/testing/selftests/timers/Makefile

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ TEST_GEN_PROGS_EXTENDED = alarmtimer-suspend valid-adjtimex adjtick change_skew
1313

1414
include ../lib.mk
1515

16+
define RUN_DESTRUCTIVE_TESTS
17+
@for TEST in $(TEST_GEN_PROGS_EXTENDED); do \
18+
BASENAME_TEST=`basename $$TEST`; \
19+
if [ ! -x $$BASENAME_TEST ]; then \
20+
echo "selftests: Warning: file $$BASENAME_TEST is not executable, correct this.";\
21+
echo "selftests: $$BASENAME_TEST [FAIL]"; \
22+
else \
23+
cd `dirname $$TEST`; (./$$BASENAME_TEST && echo "selftests: $$BASENAME_TEST [PASS]") || echo "selftests: $$BASENAME_TEST [FAIL]"; cd -;\
24+
fi; \
25+
done;
26+
endef
27+
1628
# these tests require escalated privileges
1729
# and may modify the system time or trigger
1830
# other behavior like suspend
1931
run_destructive_tests: run_tests
20-
./alarmtimer-suspend
21-
./valid-adjtimex
22-
./adjtick
23-
./change_skew
24-
./skew_consistency
25-
./clocksource-switch
26-
./freq-step
27-
./leap-a-day -s -i 10
28-
./leapcrash
29-
./set-tz
30-
./set-tai
31-
./set-2038
32-
32+
$(RUN_DESTRUCTIVE_TESTS)

0 commit comments

Comments
 (0)