tests/xtimer_usleep: use test_utils_interactive_sync

Use test_utils_interactive_sync for synchronizing test instead of the
custom 'getchar' handling.
This commit is contained in:
Gaëtan Harter 2019-08-12 16:42:21 +02:00
parent f193ffd604
commit 1172ca9f93
No known key found for this signature in database
GPG Key ID: 76DF6BCF1B1F883B
3 changed files with 5 additions and 7 deletions

View File

@ -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

View File

@ -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;

View File

@ -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):