Skip to content

Commit

Permalink
Merge pull request #20967 from maribu/tests/no-sync-control
Browse files Browse the repository at this point in the history
tests: no default interactive sync for native
  • Loading branch information
maribu authored Nov 14, 2024
2 parents 70aa1ec + 562f1f0 commit 51d1ebe
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 10 deletions.
21 changes: 12 additions & 9 deletions tests/Makefile.tests_common
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
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 testing Kconfig
DEFAULT_MODULE += test_utils_interactive_sync
# add stack metric printing configuration when testing Kconfig
# 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

BOARD ?= native
RIOTBASE ?= $(CURDIR)/../..
QUIET ?= 1
# DEVELHELP enabled by default for all tests, set 0 to disable
DEVELHELP ?= 1
3 changes: 2 additions & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 4 additions & 0 deletions tests/net/gnrc_sixlowpan_frag_sfr_congure/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 5 additions & 0 deletions tests/periph/timer_periodic/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions tests/sys/posix_sleep/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 51d1ebe

Please sign in to comment.