mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Makefile.include: add a 'test/available' target
This allows querying the build system if there are test available. Before, one should rely on 'info-debug-variable-TESTS' to print the list of test files. But was not reliable as sometime the build system printed messages anyway. BOARD=esp32-wroom-32 make --silent --no-print-directory \ -C examples/hello-world/ info-debug-variable-TESTS ESP32_SDK_DIR should be defined as /path/to/esp-idf directory ESP32_SDK_DIR is set by default to /opt/esp/esp-idf # empty line here Now the return code can be trusted.
This commit is contained in:
parent
45e1b47b26
commit
ec4d83727a
@ -569,7 +569,7 @@ reset:
|
|||||||
$(call check_cmd,$(RESET),Reset program)
|
$(call check_cmd,$(RESET),Reset program)
|
||||||
$(RESET) $(RESET_FLAGS)
|
$(RESET) $(RESET_FLAGS)
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test test/available
|
||||||
TESTS ?= $(foreach file,$(wildcard $(APPDIR)/tests/*),\
|
TESTS ?= $(foreach file,$(wildcard $(APPDIR)/tests/*),\
|
||||||
$(shell test -f $(file) -a -x $(file) && echo $(file)))
|
$(shell test -f $(file) -a -x $(file) && echo $(file)))
|
||||||
test: $(TEST_DEPS)
|
test: $(TEST_DEPS)
|
||||||
@ -577,6 +577,10 @@ test: $(TEST_DEPS)
|
|||||||
$$t || exit 1; \
|
$$t || exit 1; \
|
||||||
done
|
done
|
||||||
|
|
||||||
|
test/available:
|
||||||
|
$(Q)test -n "$(strip $(TESTS))"
|
||||||
|
|
||||||
|
|
||||||
# Default OBJDUMPFLAGS for platforms which do not specify it:
|
# Default OBJDUMPFLAGS for platforms which do not specify it:
|
||||||
OBJDUMPFLAGS ?= -S -D -h
|
OBJDUMPFLAGS ?= -S -D -h
|
||||||
|
|
||||||
|
@ -20,3 +20,10 @@ testing.
|
|||||||
From the test application directory run:
|
From the test application directory run:
|
||||||
|
|
||||||
BOARD=<board_of_your_choice> make flash test
|
BOARD=<board_of_your_choice> make flash test
|
||||||
|
|
||||||
|
|
||||||
|
An automated way of knowing if a test is available is to execute the
|
||||||
|
'test/available' target from the test application directory.
|
||||||
|
It executes without error if tests run by 'make test' are present.
|
||||||
|
|
||||||
|
make test/available
|
||||||
|
Loading…
Reference in New Issue
Block a user