mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
3db9eab6d9
- Since `printf()` is buffered it might not arrive in a single read to pexpect. Regex which terminate in a group match might match only some elements, this might break tests that depend on exact group matching.
24 lines
608 B
Python
Executable File
24 lines
608 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import sys
|
|
from testrunner import run
|
|
|
|
|
|
def testfunc(child):
|
|
child.expect(r'NUM_CHILDREN: (\d+), NUM_ITERATIONS: (\d+)\r\n')
|
|
children = int(child.match.group(1))
|
|
iterations = int(child.match.group(2))
|
|
for i in range(children):
|
|
child.expect('Start {}'.format(i + 1))
|
|
for _ in range(children * iterations):
|
|
child.expect(r'Child \d sleeps for [" "\d]+ us.')
|
|
child.expect('Done 2')
|
|
child.expect('Done 1')
|
|
child.expect('Done 3')
|
|
child.expect('Done 4')
|
|
child.expect('SUCCESS')
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(run(testfunc))
|