all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES)
define RUN_TESTS
- @for TEST in $(TEST_GEN_PROGS) $(TEST_PROGS); do \
+ @for TEST in $(1); do \
BASENAME_TEST=`basename $$TEST`; \
if [ ! -x $$BASENAME_TEST ]; then \
echo "selftests: Warning: file $$BASENAME_TEST is not executable, correct this.";\
endef
run_tests: all
- $(RUN_TESTS)
+ $(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_PROGS))
define INSTALL_RULE
@if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then \
include ../lib.mk
-define RUN_DESTRUCTIVE_TESTS
- @for TEST in $(DESTRUCTIVE_TESTS); 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
- $(RUN_DESTRUCTIVE_TESTS)
+ $(call RUN_TESTS, $(DESTRUCTIVE_TESTS))