tests/posix_time: 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
1172ca9f93
commit
ed27d3b68b
@ -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
|
||||
|
||||
|
||||
@ -26,11 +26,11 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#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;
|
||||
|
||||
@ -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):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user