pytest_eventfd.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # SPDX-FileCopyrightText: 2022 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.generic
  13. def test_eventfd(dut: Dut) -> None:
  14. dut.expect_exact('cpu_start: Starting scheduler')
  15. exp_list_5seconds = [
  16. 'eventfd_example: Select timeouted for 1 times',
  17. 'eventfd_example: Timer triggerred for 2 times',
  18. 'eventfd_example: Progress triggerred for 1 times',
  19. ]
  20. exp_list_10seconds = [
  21. 'eventfd_example: Select timeouted for 2 times',
  22. 'eventfd_example: Timer triggerred for 4 times',
  23. 'eventfd_example: Progress triggerred for 2 times',
  24. ]
  25. logging.info('Expecting:{}{}'.format(os.linesep, os.linesep.join(exp_list_5seconds)))
  26. for exp in exp_list_5seconds:
  27. dut.expect_exact(exp)
  28. logging.info('Expecting:{}{}'.format(os.linesep, os.linesep.join(exp_list_10seconds)))
  29. for exp in exp_list_10seconds:
  30. dut.expect_exact(exp)