1
0
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:
Gaëtan Harter 2019-03-23 18:03:44 +01:00
parent 45e1b47b26
commit ec4d83727a
No known key found for this signature in database
GPG Key ID: 76DF6BCF1B1F883B
2 changed files with 12 additions and 1 deletions

View File

@ -569,7 +569,7 @@ reset:
$(call check_cmd,$(RESET),Reset program)
$(RESET) $(RESET_FLAGS)
.PHONY: test
.PHONY: test test/available
TESTS ?= $(foreach file,$(wildcard $(APPDIR)/tests/*),\
$(shell test -f $(file) -a -x $(file) && echo $(file)))
test: $(TEST_DEPS)
@ -577,6 +577,10 @@ test: $(TEST_DEPS)
$$t || exit 1; \
done
test/available:
$(Q)test -n "$(strip $(TESTS))"
# Default OBJDUMPFLAGS for platforms which do not specify it:
OBJDUMPFLAGS ?= -S -D -h

View File

@ -20,3 +20,10 @@ testing.
From the test application directory run:
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