pytest_esp_flash.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
  2. # SPDX-License-Identifier: Apache-2.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.esp32c3
  9. @pytest.mark.esp32c2
  10. @pytest.mark.generic
  11. @pytest.mark.parametrize(
  12. 'config',
  13. [
  14. 'release',
  15. 'flash_qio',
  16. ],
  17. indirect=True,
  18. )
  19. def test_esp_flash(dut: Dut) -> None:
  20. dut.expect_exact('Press ENTER to see the list of tests')
  21. dut.write('[esp_flash]')
  22. dut.expect_unity_test_output()
  23. @pytest.mark.esp32s3
  24. @pytest.mark.esp32c3
  25. @pytest.mark.esp32c2
  26. @pytest.mark.generic
  27. @pytest.mark.parametrize(
  28. 'config',
  29. [
  30. 'rom_impl',
  31. ],
  32. indirect=True,
  33. )
  34. def test_esp_flash_rom(dut: Dut) -> None:
  35. dut.expect_exact('Press ENTER to see the list of tests')
  36. dut.write('[esp_flash]')
  37. dut.expect_unity_test_output()
  38. @pytest.mark.esp32
  39. @pytest.mark.esp32s2
  40. @pytest.mark.esp32s3
  41. @pytest.mark.esp32c3
  42. @pytest.mark.esp32c2
  43. @pytest.mark.flash_mutli
  44. @pytest.mark.parametrize(
  45. 'config',
  46. [
  47. 'release',
  48. ],
  49. indirect=True,
  50. )
  51. def test_esp_flash_multi(dut: Dut) -> None:
  52. dut.expect_exact('Press ENTER to see the list of tests')
  53. dut.write('[esp_flash_multi]')
  54. dut.expect_unity_test_output()