mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #17196 from maribu/tests/pthread_barrier
tests/pthread_barrier: fix test script
This commit is contained in:
commit
6dd0521203
@ -9,13 +9,17 @@ def testfunc(child):
|
||||
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(f'Start {i + 1}')
|
||||
for _ in range(iterations):
|
||||
sleeps = []
|
||||
for _ in range(children):
|
||||
child.expect(r'Child (\d+) sleeps for \s* (\d+) us.\r\n')
|
||||
child_num = int(child.match.group(1))
|
||||
sleep = int(child.match.group(2))
|
||||
sleeps.append([sleep, child_num])
|
||||
for _, child_num in sorted(sleeps):
|
||||
child.expect(r'Done (\d+)\r\n')
|
||||
assert(child_num == int(child.match.group(1)))
|
||||
child.expect('SUCCESS')
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user