example_test.py 933 B

123456789101112131415161718192021222324252627282930
  1. from __future__ import print_function
  2. import re
  3. import ttfw_idf
  4. @ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32', 'esp32s2', 'esp32c3'])
  5. def test_startup_time_example(env, extra_data):
  6. app_name = 'startup_time'
  7. dut = env.get_dut(app_name, 'examples/system/startup_time')
  8. dut.start_app()
  9. res = dut.expect(re.compile(r'\((\d+)\) [^:]+: App started!'))
  10. time = int(res[0])
  11. # Allow ci-dashboard to track startup times
  12. print('------ startup time info ------\n'
  13. '[app_name] {}\n'
  14. '[startup_time] {}\n'
  15. '[config] {}\n'
  16. '[target] {}\n'
  17. '------ startup time end ------'.format(app_name,
  18. time,
  19. dut.app.config_name,
  20. dut.TARGET))
  21. if __name__ == '__main__':
  22. test_startup_time_example()