Files
esp-idf/tools/test_apps/system/eh_frame/pytest_eh_frame.py

30 lines
1.2 KiB
Python
Raw Normal View History

2025-02-24 10:18:03 +08:00
# SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
2024-08-27 16:56:43 +08:00
# SPDX-License-Identifier: CC0-1.0
import pytest
from pytest_embedded import Dut
2025-02-24 10:18:03 +08:00
from pytest_embedded_idf.utils import idf_parametrize
2024-08-27 16:56:43 +08:00
@pytest.mark.generic
2025-02-24 10:18:03 +08:00
@idf_parametrize(
'target', ['esp32c2', 'esp32c3', 'esp32c5', 'esp32c6', 'esp32c61', 'esp32h2', 'esp32p4'], indirect=['target']
)
2024-08-27 16:56:43 +08:00
def test_eh_frame_wdt(dut: Dut) -> None:
dut.expect_exact('Press ENTER to see the list of tests')
dut.confirm_write('"Test task wdt can print backtrace with eh-frame"', expect_str=f'Running')
# Expect a backtrace which is at least 3 PC-SP pairs deep
dut.expect(r'Backtrace: (0x[a-fA-F0-9]+:0x[a-fA-F0-9]+\s*){3,}')
@pytest.mark.generic
2025-02-24 10:18:03 +08:00
@idf_parametrize(
'target', ['esp32c2', 'esp32c3', 'esp32c5', 'esp32c6', 'esp32c61', 'esp32h2', 'esp32p4'], indirect=['target']
)
2024-08-27 16:56:43 +08:00
def test_eh_frame_panic(dut: Dut) -> None:
dut.expect_exact('Press ENTER to see the list of tests')
dut.confirm_write('"Test panic can print backtrace with eh-frame"', expect_str=f'Running')
# Expect a backtrace which is at least 3 PC-SP pairs deep
dut.expect(r'Backtrace: (0x[a-fA-F0-9]+:0x[a-fA-F0-9]+\s*){3,}')