Skip to content

Commit

Permalink
change(tools): enhance expect_reg_dump to support any or specific c…
Browse files Browse the repository at this point in the history
…ore values
  • Loading branch information
erhankur committed Dec 9, 2024
1 parent ef14d7a commit dfc248d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tools/test_apps/system/panic/pytest_panic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1066,11 +1066,11 @@ def test_tcb_corrupted(dut: PanicTestDut, target: str, config: str, test_func_na
dut.run_test_func(test_func_name)
if dut.is_xtensa:
dut.expect_gme('LoadProhibited')
dut.expect_reg_dump(0)
dut.expect_reg_dump()
dut.expect_backtrace()
else:
dut.expect_gme('Load access fault')
dut.expect_reg_dump(0)
dut.expect_reg_dump()
dut.expect_stack_dump()

dut.expect_elf_sha256()
Expand Down
10 changes: 7 additions & 3 deletions tools/test_apps/system/panic/test_panic_util/panic_dut.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,13 @@ def expect_gme(self, reason: str) -> None:
"""Expect method for Guru Meditation Errors"""
self.expect_exact(f"Guru Meditation Error: Core 0 panic'ed ({reason})")

def expect_reg_dump(self, core: int = 0) -> None:
"""Expect method for the register dump"""
self.expect(r'Core\s+%d register dump:' % core)
def expect_reg_dump(self, core: Optional[int] = None) -> None:
if core is None:
# Match any core num
self.expect(r'Core\s+\d+\s+register dump:')
else:
# Match the exact core num provided
self.expect(r'Core\s+%d\s+register dump:' % core)

def expect_cpu_reset(self) -> None:
# no digital system reset for panic handling restarts (see IDF-7255)
Expand Down

0 comments on commit dfc248d

Please sign in to comment.