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:
Gaëtan Harter 2019-08-12 16:42:21 +02:00
parent 1172ca9f93
commit ed27d3b68b
No known key found for this signature in database
GPG Key ID: 76DF6BCF1B1F883B
3 changed files with 5 additions and 7 deletions

View File

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

View File

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

View File

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