Files
esp-idf/examples/cxx/exceptions/pytest_examples_cxx_exceptions.py

21 lines
669 B
Python
Raw Normal View History

2025-02-24 10:18:03 +08:00
# SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Unlicense OR CC0-1.0
import pytest
from pytest_embedded_idf.dut import IdfDut
2025-02-24 10:18:03 +08:00
from pytest_embedded_idf.utils import idf_parametrize
@pytest.mark.generic
2025-02-24 10:18:03 +08:00
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
def test_examples_cpp_exceptions(dut: IdfDut) -> None:
lines = [
'app_main starting',
'In constructor, arg=42',
'In constructor, arg=0',
'In destructor, m_arg=42',
'Exception caught: Exception in constructor',
'app_main done',
]
for line in lines:
dut.expect(line, timeout=2)