From ed27d3b68b8e688c0e62738f478a62b2302ff05f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Mon, 12 Aug 2019 16:42:21 +0200 Subject: [PATCH] tests/posix_time: use test_utils_interactive_sync Use test_utils_interactive_sync for synchronizing test instead of the custom 'getchar' handling. --- tests/posix_time/Makefile | 3 +-- tests/posix_time/main.c | 4 ++-- tests/posix_time/tests/01-run.py | 5 ++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/posix_time/Makefile b/tests/posix_time/Makefile index d1a1ee9bb8..80171ab760 100644 --- a/tests/posix_time/Makefile +++ b/tests/posix_time/Makefile @@ -2,8 +2,7 @@ include ../Makefile.tests_common USEMODULE += posix_time -# This application uses getchar and thus expects input from stdio -USEMODULE += stdin +USEMODULE += test_utils_interactive_sync TEST_ON_CI_WHITELIST += all diff --git a/tests/posix_time/main.c b/tests/posix_time/main.c index e79fbced2b..670838ca14 100644 --- a/tests/posix_time/main.c +++ b/tests/posix_time/main.c @@ -26,11 +26,11 @@ #include #include +#include "test_utils/interactive_sync.h" int main(void) { - puts("Please hit any key and then ENTER to continue"); - getchar(); + test_utils_interactive_sync(); puts("5 x usleep(i++ * 500000)"); for (unsigned i = 0; i < 5; i++) { useconds_t us = i * 500000u; diff --git a/tests/posix_time/tests/01-run.py b/tests/posix_time/tests/01-run.py index 2f4dab0d66..8a2d57433a 100755 --- a/tests/posix_time/tests/01-run.py +++ b/tests/posix_time/tests/01-run.py @@ -10,7 +10,7 @@ import sys import time -from testrunner import run +from testrunner import run, test_utils_interactive_sync US_PER_SEC = 1000000 EXTERNAL_JITTER = 0.15 @@ -22,8 +22,7 @@ class InvalidTimeout(Exception): def testfunc(child): try: - child.expect_exact("Please hit any key and then ENTER to continue") - child.sendline("a") + test_utils_interactive_sync(child) start_test = time.time() child.expect_exact("5 x usleep(i++ * 500000)") for i in range(5):