pytest_ulp_fsm_app.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # SPDX-FileCopyrightText: 2022 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.esp32s3
  8. @pytest.mark.generic
  9. def test_ulp_fsm(dut: Dut) -> None:
  10. dut.expect('Press ENTER to see the list of tests')
  11. dut.write('![ulp_deep_sleep_wakeup]')
  12. dut.expect_unity_test_output()
  13. # Run all deepsleep wakeup tests one after the other instead of running them all with the `ulp_deep_sleep_wakeup` tag.
  14. # This makes sure that all tests are run even after one test causes a system reset.
  15. @pytest.mark.esp32
  16. @pytest.mark.esp32s2
  17. @pytest.mark.esp32s3
  18. @pytest.mark.generic
  19. def test_ulp_fsm_deep_sleep_wakeup(dut: Dut) -> None:
  20. dut.expect('Press ENTER to see the list of tests')
  21. dut.write('"ULP FSM deep-sleep wakeup test"')
  22. dut.expect('rst:0x5')
  23. @pytest.mark.esp32
  24. @pytest.mark.esp32s2
  25. @pytest.mark.esp32s3
  26. @pytest.mark.generic
  27. def test_ulp_fsm_rtc_io(dut: Dut) -> None:
  28. dut.expect('Press ENTER to see the list of tests')
  29. dut.write('"ULP FSM controls RTC_IO"')
  30. dut.expect('rst:0x5')
  31. @pytest.mark.esp32
  32. @pytest.mark.esp32s2
  33. @pytest.mark.esp32s3
  34. @pytest.mark.generic
  35. def test_ulp_fsm_deep_sleep_power_consumption(dut: Dut) -> None:
  36. dut.expect('Press ENTER to see the list of tests')
  37. dut.write('"ULP FSM power consumption in deep sleep"')
  38. dut.expect('rst:0x5')
  39. @pytest.mark.esp32s2
  40. @pytest.mark.esp32s3
  41. @pytest.mark.generic
  42. def test_ulp_fsm_tsens(dut: Dut) -> None:
  43. dut.expect('Press ENTER to see the list of tests')
  44. dut.write('"ULP FSM can use temperature sensor (TSENS) in deep sleep"')
  45. dut.expect('rst:0x5')
  46. @pytest.mark.esp32
  47. @pytest.mark.esp32s2
  48. @pytest.mark.esp32s3
  49. @pytest.mark.generic
  50. def test_ulp_fsm_adc(dut: Dut) -> None:
  51. dut.expect('Press ENTER to see the list of tests')
  52. dut.write('"ULP FSM can use ADC in deep sleep"')
  53. dut.expect('rst:0x5')