mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 04:52:59 +01:00
tests/tests.inc.mk: move tests targets and variables
Create a file for setting tests targets and variables. It is a refactoring before adding new commands.
This commit is contained in:
parent
83201ddb00
commit
4412b9a4ab
@ -758,42 +758,8 @@ reset:
|
|||||||
$(call check_cmd,$(RESET),Reset program)
|
$(call check_cmd,$(RESET),Reset program)
|
||||||
$(RESET) $(RESET_FLAGS)
|
$(RESET) $(RESET_FLAGS)
|
||||||
|
|
||||||
.PHONY: test test/available
|
# tests related targets and variables
|
||||||
TESTS ?= $(foreach file,$(wildcard $(APPDIR)/tests/*[^~]),\
|
include $(RIOTMAKE)/tests/tests.inc.mk
|
||||||
$(shell test -f $(file) -a -x $(file) && echo $(file)))
|
|
||||||
|
|
||||||
# "make test" calls "make term" which would implicitly build it's dependencies,
|
|
||||||
# but that increases the time "make test" needs to get ready. That can cause
|
|
||||||
# problems ("make term" missing some lines) as terminal startup is not properly
|
|
||||||
# sychronized, but depends on a static timeout (TESTRUNNER_START_DELAY).
|
|
||||||
# Murdock builds the term dependencies before running "make test" to circumvent
|
|
||||||
# this. In order to make local builds behave similar, add the term deps here.
|
|
||||||
# See #11762.
|
|
||||||
TEST_DEPS += $(TERMDEPS)
|
|
||||||
|
|
||||||
# Export TESTRUNNER_RESET_AFTER_TERM only for the test target. This allows for
|
|
||||||
# it to be accessed through the environment from python test script.
|
|
||||||
# This is currently needed only by `examples/%/tests` and should be removed in
|
|
||||||
# the future since `make reset` after `term` is not a valid synch method across
|
|
||||||
# all platforms.
|
|
||||||
$(call target-export-variables,test,TESTRUNNER_RESET_AFTER_TERM)
|
|
||||||
test: $(TEST_DEPS)
|
|
||||||
$(Q) for t in $(TESTS); do \
|
|
||||||
$$t || exit 1; \
|
|
||||||
done
|
|
||||||
|
|
||||||
test/available:
|
|
||||||
$(Q)test -n "$(strip $(TESTS))"
|
|
||||||
|
|
||||||
# this target only makes sense if an ELFFILE is actually created, thus guard by
|
|
||||||
# RIOTNOLINK="".
|
|
||||||
ifeq (,$(RIOTNOLINK))
|
|
||||||
test-input-hash: $(TESTS) $(ELFFILE) $(TEST_EXTRA_FILES)
|
|
||||||
sha1sum $^ > $(BINDIR)/test-input-hash.sha1
|
|
||||||
else
|
|
||||||
test-input-hash:
|
|
||||||
true
|
|
||||||
endif
|
|
||||||
|
|
||||||
.PHONY: fuzz
|
.PHONY: fuzz
|
||||||
fuzz:
|
fuzz:
|
||||||
|
37
makefiles/tests/tests.inc.mk
Normal file
37
makefiles/tests/tests.inc.mk
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# Export TESTRUNNER_RESET_AFTER_TERM only for the test target. This allows for
|
||||||
|
# it to be accessed through the environment from python test script.
|
||||||
|
# This is currently needed only by `examples/%/tests` and should be removed in
|
||||||
|
# the future since `make reset` after `term` is not a valid synch method across
|
||||||
|
# all platforms.
|
||||||
|
$(call target-export-variables,test test-as-root test-with-config,TESTRUNNER_RESET_AFTER_TERM)
|
||||||
|
|
||||||
|
.PHONY: test test/available
|
||||||
|
TESTS ?= $(foreach file,$(wildcard $(APPDIR)/tests/*[^~]),\
|
||||||
|
$(shell test -f $(file) -a -x $(file) && echo $(file)))
|
||||||
|
|
||||||
|
# "make test" calls "make term" which would implicitly build it's dependencies,
|
||||||
|
# but that increases the time "make test" needs to get ready. That can cause
|
||||||
|
# problems ("make term" missing some lines) as terminal startup is not properly
|
||||||
|
# sychronized, but depends on a static timeout (TESTRUNNER_START_DELAY).
|
||||||
|
# Murdock builds the term dependencies before running "make test" to circumvent
|
||||||
|
# this. In order to make local builds behave similar, add the term deps here.
|
||||||
|
# See #11762.
|
||||||
|
TEST_DEPS += $(TERMDEPS)
|
||||||
|
|
||||||
|
test: $(TEST_DEPS)
|
||||||
|
$(Q) for t in $(TESTS); do \
|
||||||
|
$$t || exit 1; \
|
||||||
|
done
|
||||||
|
|
||||||
|
test/available:
|
||||||
|
$(Q)test -n "$(strip $(TESTS))"
|
||||||
|
|
||||||
|
# this target only makes sense if an ELFFILE is actually created, thus guard by
|
||||||
|
# RIOTNOLINK="".
|
||||||
|
ifeq (,$(RIOTNOLINK))
|
||||||
|
test-input-hash: $(TESTS) $(ELFFILE) $(TEST_EXTRA_FILES)
|
||||||
|
sha1sum $^ > $(BINDIR)/test-input-hash.sha1
|
||||||
|
else
|
||||||
|
test-input-hash:
|
||||||
|
true
|
||||||
|
endif
|
Loading…
Reference in New Issue
Block a user