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
|
USEMODULE += posix_time
|
||||||
|
|
||||||
# This application uses getchar and thus expects input from stdio
|
USEMODULE += test_utils_interactive_sync
|
||||||
USEMODULE += stdin
|
|
||||||
|
|
||||||
TEST_ON_CI_WHITELIST += all
|
TEST_ON_CI_WHITELIST += all
|
||||||
|
|
||||||
|
|||||||
@ -26,11 +26,11 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
puts("Please hit any key and then ENTER to continue");
|
test_utils_interactive_sync();
|
||||||
getchar();
|
|
||||||
puts("5 x usleep(i++ * 500000)");
|
puts("5 x usleep(i++ * 500000)");
|
||||||
for (unsigned i = 0; i < 5; i++) {
|
for (unsigned i = 0; i < 5; i++) {
|
||||||
useconds_t us = i * 500000u;
|
useconds_t us = i * 500000u;
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
from testrunner import run
|
from testrunner import run, test_utils_interactive_sync
|
||||||
|
|
||||||
US_PER_SEC = 1000000
|
US_PER_SEC = 1000000
|
||||||
EXTERNAL_JITTER = 0.15
|
EXTERNAL_JITTER = 0.15
|
||||||
@ -22,8 +22,7 @@ class InvalidTimeout(Exception):
|
|||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
try:
|
try:
|
||||||
child.expect_exact("Please hit any key and then ENTER to continue")
|
test_utils_interactive_sync(child)
|
||||||
child.sendline("a")
|
|
||||||
start_test = time.time()
|
start_test = time.time()
|
||||||
child.expect_exact("5 x usleep(i++ * 500000)")
|
child.expect_exact("5 x usleep(i++ * 500000)")
|
||||||
for i in range(5):
|
for i in range(5):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user