1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 00:49:45 +01:00
RIOT/tests/Makefile.tests_common
Marian Buschsieweke cedfb63a88
tests: no default interactive sync for native
The aim is to allow faster test cycles on native for unit test style
apps (that don't need interaction) by bypassing the python test
framework using e.g.:

    make RIOT_TERMINAL=native all term

This would work already before, but now is more convenient as no
manual press of the `s` key is needed to start the test.

For non-native boards we need the sync, as otherwise the board may
finish booting before the python test automation framework can capture
output. For `native` and `native64`, we actually control when the RIOT
app is started and do not need to sync.

On a typical machine this can reduce the test cycle by more than 4
seconds.

With this change:

    $ time sh -c 'make BOARD=native -C tests/unittests tests-nanocoap -j && make BOARD=native RIOT_TERMINAL=native -C tests/unittests term'
    [...]
    main(): This is RIOT! (Version: 2024.10-devel-394-gd65dec-tests/no-sync-control)
    ...................................
    OK (35 tests)
    [...]
    make: Leaving directory '/home/marian.buschsieweke@ml-pa.loc/Repos/software/RIOT/master/tests/unittests'
    sh -c   0.30s user 0.24s system 113% cpu 0.476 total

Before t his change:

    $ time sh -c 'make BOARD=native -C tests/unittests tests-nanocoap -j && make BOARD=native -C tests/unittests test'
    [...]
    main(): This is RIOT! (Version: 2024.10-devel-394-gd65dec-tests/no-sync-control)
    Help: Press s to start test, r to print it is ready
    READY
    s
    START
    ...................................
    OK (35 tests)
    [...]
    make: Leaving directory '/home/marian.buschsieweke@ml-pa.loc/Repos/software/RIOT/master/tests/unittests'
    sh -c   0.50s user 0.37s system 17% cpu 4.863 total
2024-11-08 13:24:32 +01:00

21 lines
701 B
Makefile

APPLICATION ?= tests_$(notdir $(patsubst %/,%,$(CURDIR)))
BOARD ?= native
RIOTBASE ?= $(CURDIR)/../..
QUIET ?= 1
# DEVELHELP enabled by default for all tests, set 0 to disable
DEVELHELP ?= 1
ifneq (,$(wildcard $(CURDIR)/tests*/.))
# add interactive test configuration when automated testing is available,
# except for `native` and `native64` where we control when the RIOT app is
# started
ifeq (,$(filter native native64,$(BOARD)))
DEFAULT_MODULE += test_utils_interactive_sync
endif
# print stack usage by default when automated testing is available
DEFAULT_MODULE += test_utils_print_stack_usage
endif
# terminate native when the test is complete
CFLAGS += -DNATIVE_AUTO_EXIT=1