pytest_esp_event.py 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
  2. # SPDX-License-Identifier: CC0-1.0
  3. import pytest
  4. from pytest_embedded import Dut
  5. @pytest.mark.esp32
  6. @pytest.mark.esp32s2
  7. @pytest.mark.esp32c3
  8. @pytest.mark.generic
  9. def test_esp_event(dut: Dut) -> None:
  10. dut.run_all_single_board_cases()
  11. @pytest.mark.esp32
  12. @pytest.mark.host_test
  13. @pytest.mark.qemu
  14. @pytest.mark.parametrize('qemu_extra_args', [
  15. '-global driver=timer.esp32.timg,property=wdt_disable,value=true',
  16. ], indirect=True) # need to disable wdt since it is not synchronized with target cpu clock on QEMU for ESP32
  17. def test_esp_event_qemu_esp32(dut: Dut) -> None:
  18. for case in dut.test_menu:
  19. if 'qemu-ignore' not in case.groups and not case.is_ignored and case.type == 'normal':
  20. dut._run_normal_case(case)
  21. @pytest.mark.esp32c3
  22. @pytest.mark.host_test
  23. @pytest.mark.qemu
  24. @pytest.mark.parametrize('qemu_extra_args', [
  25. '-icount 3',
  26. ], indirect=True) # need to add -icount 3 to make WDT accurate on QEMU for ESP32-C3
  27. def test_esp_event_qemu_esp32c3(dut: Dut) -> None:
  28. for case in dut.test_menu:
  29. if 'qemu-ignore' not in case.groups and not case.is_ignored and case.type == 'normal':
  30. dut._run_normal_case(case)