diff --git a/tests/xtimer_usleep/Makefile b/tests/xtimer_usleep/Makefile index 48cf81df4e..db3f153186 100644 --- a/tests/xtimer_usleep/Makefile +++ b/tests/xtimer_usleep/Makefile @@ -6,8 +6,7 @@ TEST_ON_CI_WHITELIST += all # This test randomly fails on `native` so disable it from CI TEST_ON_CI_BLACKLIST += native -# This application uses getchar and thus expects input from stdio -USEMODULE += stdin +USEMODULE += test_utils_interactive_sync # Port and pin configuration for probing with oscilloscope # Port number should be found in port enum e.g in cpu/include/periph_cpu.h diff --git a/tests/xtimer_usleep/main.c b/tests/xtimer_usleep/main.c index 12949b7fa5..f54d5c450e 100644 --- a/tests/xtimer_usleep/main.c +++ b/tests/xtimer_usleep/main.c @@ -27,6 +27,7 @@ #include "xtimer.h" #include "timex.h" +#include "test_utils/interactive_sync.h" #define RUNS (5U) #define SLEEP_TIMES_NUMOF ARRAY_SIZE(sleep_times) @@ -61,8 +62,7 @@ int main(void) printf("Running test %u times with %u distinct sleep times\n", RUNS, (unsigned)SLEEP_TIMES_NUMOF); - puts("Please hit any key and then ENTER to continue"); - getchar(); + test_utils_interactive_sync(); start_test = xtimer_now_usec(); for (unsigned m = 0; m < RUNS; m++) { for (unsigned n = 0; diff --git a/tests/xtimer_usleep/tests/01-run.py b/tests/xtimer_usleep/tests/01-run.py index 3766be750a..bcf0927baf 100755 --- a/tests/xtimer_usleep/tests/01-run.py +++ b/tests/xtimer_usleep/tests/01-run.py @@ -11,7 +11,7 @@ import sys import time -from testrunner import run +from testrunner import run, test_utils_interactive_sync US_PER_SEC = 1000000 @@ -28,8 +28,7 @@ def testfunc(child): RUNS = int(child.match.group(1)) SLEEP_TIMES_NUMOF = int(child.match.group(2)) try: - child.expect_exact(u"Please hit any key and then ENTER to continue") - child.sendline(u"a") + test_utils_interactive_sync(child) start_test = time.time() for m in range(RUNS): for n in range(SLEEP_TIMES_NUMOF):