pytest_eventfd.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
  2. # SPDX-License-Identifier: CC0-1.0
  3. import logging
  4. import os
  5. import pytest
  6. from pytest_embedded import Dut
  7. @pytest.mark.esp32
  8. @pytest.mark.esp32c2
  9. @pytest.mark.esp32s2
  10. @pytest.mark.esp32s3
  11. @pytest.mark.esp32c3
  12. @pytest.mark.esp32c6
  13. @pytest.mark.esp32h2
  14. @pytest.mark.generic
  15. def test_eventfd(dut: Dut) -> None:
  16. dut.expect_exact('main_task: Calling app_main()')
  17. exp_list_5seconds = [
  18. 'eventfd_example: Select timeouted for 1 times',
  19. 'eventfd_example: Timer triggerred for 2 times',
  20. 'eventfd_example: Progress triggerred for 1 times',
  21. ]
  22. exp_list_10seconds = [
  23. 'eventfd_example: Select timeouted for 2 times',
  24. 'eventfd_example: Timer triggerred for 4 times',
  25. 'eventfd_example: Progress triggerred for 2 times',
  26. ]
  27. logging.info('Expecting:{}{}'.format(os.linesep, os.linesep.join(exp_list_5seconds)))
  28. for exp in exp_list_5seconds:
  29. dut.expect_exact(exp)
  30. logging.info('Expecting:{}{}'.format(os.linesep, os.linesep.join(exp_list_10seconds)))
  31. for exp in exp_list_10seconds:
  32. dut.expect_exact(exp)