example_test.py 812 B

12345678910111213141516171819202122232425262728
  1. from __future__ import print_function
  2. import os
  3. import sys
  4. test_fw_path = os.getenv('TEST_FW_PATH')
  5. if test_fw_path and test_fw_path not in sys.path:
  6. sys.path.insert(0, test_fw_path)
  7. import TinyFW
  8. import IDF
  9. @IDF.idf_example_test(env_tag='Example_WIFI')
  10. def test_examples_system_cpp_exceptions(env, extra_data):
  11. dut = env.get_dut('cpp_exceptions_example', 'examples/system/cpp_exceptions')
  12. # start test
  13. dut.start_app()
  14. lines = ['app_main starting',
  15. 'In constructor, arg=42',
  16. 'In constructor, arg=0',
  17. 'In destructor, m_arg=42',
  18. 'Exception caught: Exception in constructor',
  19. 'app_main done'
  20. ]
  21. for line in lines:
  22. dut.expect(line, timeout=2)
  23. if __name__ == '__main__':
  24. test_examples_system_cpp_exceptions()