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:
parent
f193ffd604
commit
1172ca9f93
@ -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
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user