tests/periph_wdt: wait for prompt
This commit is contained in:
parent
2e542a2488
commit
dd4f6600b8
@ -37,6 +37,7 @@ def get_reset_time(child):
|
|||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
|
child.expect_exact(">")
|
||||||
child.sendline("range")
|
child.sendline("range")
|
||||||
child.expect(r"lower_bound: (\d+) upper_bound: (\d+)\s*\r\n",
|
child.expect(r"lower_bound: (\d+) upper_bound: (\d+)\s*\r\n",
|
||||||
timeout=1)
|
timeout=1)
|
||||||
@ -44,10 +45,12 @@ def testfunc(child):
|
|||||||
wdt_upper_bound = int(child.match.group(2))
|
wdt_upper_bound = int(child.match.group(2))
|
||||||
|
|
||||||
for rst_time in reset_times_ms:
|
for rst_time in reset_times_ms:
|
||||||
|
child.expect_exact(">")
|
||||||
child.sendline("setup 0 {}".format(rst_time))
|
child.sendline("setup 0 {}".format(rst_time))
|
||||||
if rst_time < wdt_lower_bound or rst_time > wdt_upper_bound:
|
if rst_time < wdt_lower_bound or rst_time > wdt_upper_bound:
|
||||||
child.expect_exact("invalid time, see \"range\"", timeout=1)
|
child.expect_exact("invalid time, see \"range\"", timeout=1)
|
||||||
else:
|
else:
|
||||||
|
child.expect_exact(">")
|
||||||
child.sendline("startloop")
|
child.sendline("startloop")
|
||||||
child.expect(r"start time: (\d+) us", timeout=1)
|
child.expect(r"start time: (\d+) us", timeout=1)
|
||||||
start_time_us = int(child.match.group(1))
|
start_time_us = int(child.match.group(1))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user