pytest_examples_cxx_exceptions.py 570 B

12345678910111213141516171819
  1. # SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
  2. # SPDX-License-Identifier: Unlicense OR CC0-1.0
  3. import pytest
  4. from pytest_embedded_idf.dut import IdfDut
  5. @pytest.mark.supported_targets
  6. @pytest.mark.generic
  7. def test_examples_cpp_exceptions(dut: IdfDut) -> None:
  8. lines = [
  9. 'app_main starting',
  10. 'In constructor, arg=42',
  11. 'In constructor, arg=0',
  12. 'In destructor, m_arg=42',
  13. 'Exception caught: Exception in constructor',
  14. 'app_main done',
  15. ]
  16. for line in lines:
  17. dut.expect(line, timeout=2)