1from __future__ import print_function
2
3import ttfw_idf
4
5
6@ttfw_idf.idf_example_test(env_tag='Example_GENERIC')
7def test_examples_system_cpp_exceptions(env, extra_data):
8    dut = env.get_dut('cpp_exceptions_example', 'examples/cxx/exceptions', dut_class=ttfw_idf.ESP32DUT)
9    # start test
10    dut.start_app()
11    lines = ['app_main starting',
12             'In constructor, arg=42',
13             'In constructor, arg=0',
14             'In destructor, m_arg=42',
15             'Exception caught: Exception in constructor',
16             'app_main done'
17             ]
18    for line in lines:
19        dut.expect(line, timeout=2)
20
21
22if __name__ == '__main__':
23    test_examples_system_cpp_exceptions()
24