1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #12821 from kaspar030/fix_tests_malloc

tests/malloc: fix test regexp to consider whole line
This commit is contained in:
Martine Lenders 2019-11-27 14:54:42 +01:00 committed by GitHub
commit dbbdd703ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,22 +11,22 @@ from testrunner import run
def testfunc(child):
child.expect(r'CHUNK_SIZE: (\d+)')
child.expect(r'CHUNK_SIZE: (\d+)\r\n')
chunk_size = int(child.match.group(1))
child.expect(r'NUMBER_OF_TESTS: (\d+)')
child.expect(r'NUMBER_OF_TESTS: (\d+)\r\n')
number_of_tests = int(child.match.group(1))
initial_allocations = 0
for _ in range(number_of_tests):
child.expect(r"Allocated {} Bytes at 0x[a-z0-9]+, total [a-z0-9]+"
child.expect(r"Allocated {} Bytes at 0x[a-z0-9]+, total [a-z0-9]+\r\n"
.format(chunk_size))
child.expect(r'Allocations count: (\d+)')
child.expect(r'Allocations count: (\d+)\r\n')
allocations = int(child.match.group(1))
assert allocations > 0
if initial_allocations == 0:
initial_allocations = allocations
assert initial_allocations == allocations
for _ in range(allocations):
child.expect(r"Free {} Bytes at 0x[a-z0-9]+, total [a-z0-9]+"
child.expect(r"Free {} Bytes at 0x[a-z0-9]+, total [a-z0-9]+\r\n"
.format(chunk_size))
child.expect_exact("[SUCCESS]")