example_test.py 907 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env python
  2. from __future__ import division, print_function, unicode_literals
  3. import re
  4. from typing import Any
  5. import ttfw_idf
  6. @ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32', 'esp32s2', 'esp32c3'])
  7. def test_examples_pthread(env, _): # type: (Any, Any) -> None
  8. app_name = 'pthread'
  9. dut = env.get_dut(app_name, 'examples/system/pthread')
  10. dut.start_app()
  11. # Note: this test doesn't really confirm anything, except that threads are created
  12. # and stdout is not being corrupted by multiple threads printing ot it.
  13. dut.expect(re.compile(r'Created thread 0x[\da-f]+'))
  14. dut.expect(re.compile(r'Created larger stack thread 0x[\da-f]+'))
  15. dut.expect(r'Threads have exited')
  16. dut.expect(re.compile(r'Created thread 0x[\da-f]+ with new default config'))
  17. dut.expect('Thread has exited')
  18. if __name__ == '__main__':
  19. test_examples_pthread()