diff --git a/tests/Makefile.tests_common b/tests/Makefile.tests_common index cc8dc55b5c..75c42b2664 100644 --- a/tests/Makefile.tests_common +++ b/tests/Makefile.tests_common @@ -1,17 +1,20 @@ APPLICATION ?= tests_$(notdir $(patsubst %/,%,$(CURDIR))) - -ifneq (,$(wildcard $(CURDIR)/tests*/.)) - # add interactive test configuration when testing Kconfig - DEFAULT_MODULE += test_utils_interactive_sync - # add stack metric printing configuration when testing Kconfig - DEFAULT_MODULE += test_utils_print_stack_usage -endif - -# terminate native when the test is complete -CFLAGS += -DNATIVE_AUTO_EXIT=1 - 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 diff --git a/tests/README.md b/tests/README.md index 55b8ab645a..97f3c93f62 100644 --- a/tests/README.md +++ b/tests/README.md @@ -127,7 +127,8 @@ As some board can't be reset without a manual trigger tests should be implemente with some kind of `synchronization`. This can be done in two ways: - use `test_utils_interactive_sync` when uart input/output does not need to be - disabled for the test. This is enabled by default. + disabled for the test. This is enabled by default, except for `native` and + `native64`. - set up the test in a loop so the test script will be able so sync with some kind of start condition in the test. diff --git a/tests/net/gnrc_sixlowpan_frag_sfr_congure/main.c b/tests/net/gnrc_sixlowpan_frag_sfr_congure/main.c index a3cd545d43..92433293a3 100644 --- a/tests/net/gnrc_sixlowpan_frag_sfr_congure/main.c +++ b/tests/net/gnrc_sixlowpan_frag_sfr_congure/main.c @@ -802,6 +802,10 @@ int main(void) { _tests_init(); + /* work around issue in _check_congure_snd_msg(): the assert for + * time > o will not work when the time is 0 */ + while (xtimer_now_usec() / US_PER_MS == 0) { } + TESTS_START(); TESTS_RUN(tests_gnrc_sixlowpan_frag_sfr_congure_integration()); TESTS_END(); diff --git a/tests/periph/timer_periodic/Makefile b/tests/periph/timer_periodic/Makefile index c894723314..47756540f1 100644 --- a/tests/periph/timer_periodic/Makefile +++ b/tests/periph/timer_periodic/Makefile @@ -4,4 +4,9 @@ FEATURES_REQUIRED = periph_timer_periodic USEMODULE += fmt +# Interactive sync improves accuracy of timestamping the output +# and is also needed on native for the automatic test to +# pass. Hence, we just depend on it here. +USEMODULE += test_utils_interactive_sync + include $(RIOTBASE)/Makefile.include diff --git a/tests/sys/posix_sleep/Makefile b/tests/sys/posix_sleep/Makefile index 5dcb9ed74c..8967a1acd4 100644 --- a/tests/sys/posix_sleep/Makefile +++ b/tests/sys/posix_sleep/Makefile @@ -2,6 +2,11 @@ include ../Makefile.sys_common USEMODULE += posix_sleep +# Interactive sync improves accuracy of timestamping the output +# and is also needed on native for the automatic test to +# pass. Hence, we just depend on it here. +USEMODULE += test_utils_interactive_sync + # microbit qemu failing currently TEST_ON_CI_BLACKLIST += microbit