Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions tests/core/msg_queue_print/tests/01-run.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ def expect_some(child, size, avail, range_start):

def expect_content(child, counter):
if counter == 0:
if os.environ.get('BOARD') in ['native', 'native32', 'native64']:
child.expect_exact('type: 0x0000, content: 0 ((nil))')
else:
child.expect(r'type: 0x0000, content: 0 \((0x)?0+\)')
child.expect(r'type: 0x0000, content: 0 \(\(nil\)|(0x)?0+\)')
else:
child.expect_exact(f'type: 0x{counter:04x}, content: {counter} (0x{counter:x})')
child.expect(r'type: (0x[a-fA-F0-9]+), content: (\d+) \(((0x)?[a-fA-Z0-9]+)\)')
assert int(child.match.group(1), 16) == counter, f"Expected {counter:x} as type, got child.match.group(1)"
assert int(child.match.group(2)) == counter, f"Expected {counter} as content, got child.match.group(2)"
assert int(child.match.group(3), 16) == counter, f"Expected {counter:x} as ptr, got child.match.group(3)"


def testfunc(child):
Expand Down
7 changes: 4 additions & 3 deletions tests/net/gnrc_ipv6_fwd_w_sub/tests/01-run.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ def testfunc(child):
child.expect(r"00000020 55 44 33 FF FE 22 11 00 54 B8 59 AF 3A B4 5C 85")
child.expect(r"00000030 1E CE E2 EB 05 4E A3 85")
child.sendline("pktbuf")
child.expect(r"packet buffer: first byte: (0x[0-9a-fA-F]+), "
r"last byte: 0x[0-9a-fA-F]+ \(size: (\d+)\)")
child.expect(r"packet buffer: first byte: ((0x)?[0-9a-fA-F]+), "
r"last byte: (0x)?[0-9a-fA-F]+ \(size: (\d+)\)")
start_addr = child.match.group(1)
size = child.match.group(2)
size = child.match.group(4)
print(start_addr, size)
child.expect(r" position of last byte used: \d+")
child.expect(r"~ unused: {} \(next: (\(nil\)|0(x0+)?), size: +{}\) ~"
.format(start_addr, size))
Expand Down
4 changes: 2 additions & 2 deletions tests/riotboot/tests/01-run.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ def check_current_slot_and_app_ver(self, child):
# Ask for data of all slots
child.expect_exact('>')
child.sendline("dumpaddrs")
child.expect(r"slot 0: metadata: 0x[0-9a-fA-F]{1,8} "
child.expect(r"slot 0: metadata: (0x)?[0-9a-fA-F]{1,8} "
r"image: 0x[0-9a-fA-F]{8}\r\n")
child.expect(r"slot 1: metadata: 0x[0-9a-fA-F]{1,8} "
child.expect(r"slot 1: metadata: (0x)?[0-9a-fA-F]{1,8} "
r"image: 0x[0-9a-fA-F]{8}\r\n")
child.expect_exact('>')

Expand Down
4 changes: 2 additions & 2 deletions tests/sys/heap_cmd/tests/01-run.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ def testfunc(child):
if ret == 1:
return
child.sendline('malloc 100')
child.expect('allocated 0x')
child.expect('allocated (0x)?')
addr = child.readline()
addr = addr[:-2]
child.expect_exact('> ')
child.sendline('heap')
child.expect(r'heap: \d+ \(used \d+, free \d+\) \[bytes\]')
child.sendline('free 0x' + addr)
child.expect('freeing 0x' + addr)
child.expect('freeing (0x)?' + addr)
child.expect_exact('>')
child.sendline('heap')
child.expect(r'heap: \d+ \(used \d+, free \d+\) \[bytes\]')
Expand Down
4 changes: 2 additions & 2 deletions tests/sys/malloc/tests/01-run.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def testfunc(child):
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]+\r\n"
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+)\r\n',
timeout=ALLOCATION_TIMEOUT)
Expand All @@ -31,7 +31,7 @@ def testfunc(child):
if initial_allocations == 0:
initial_allocations = allocations
assert initial_allocations == allocations
child.expect(r"Free {} Bytes at 0x[a-z0-9]+, total [a-z0-9]+\r\n"
child.expect(r"Free {} Bytes at (0x)?[a-z0-9]+, total [a-z0-9]+\r\n"
.format(chunk_size))
child.expect(r'Free count: (\d+)\r\n', timeout=FREE_TIMEOUT)
freed = int(child.match.group(1))
Expand Down
4 changes: 2 additions & 2 deletions tests/sys/memarray/tests/01-run.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ def testfunc(child):
for test in range(number_of_tests):
child.expect_exact("TEST #{}:".format(test + 1))
for i in range(max_number_blocks):
child.expect(r'\({}, @@@@@@@\) Allocated \d+ Bytes at 0x[a-z0-9]+,'
child.expect(r'\({}, @@@@@@@\) Allocated \d+ Bytes at (0x)?[a-zA-Z0-9]+,'
r' total [0-9]+\r\n'.format(i))
for i in range(max_number_blocks):
child.expect(r'Free \({}\) \d+ Bytes at 0x[a-z0-9]+,'
child.expect(r'Free \({}\) \d+ Bytes at (0x)?[a-zA-Z0-9]+,'
' total [0-9]+\r\n'.format(i))

child.expect_exact("Extend and reduce tests")
Expand Down
Loading