pytest_mmap.py 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. # normal mmu tests
  6. @pytest.mark.supported_targets
  7. @pytest.mark.generic
  8. @pytest.mark.parametrize(
  9. 'config',
  10. [
  11. 'release',
  12. ],
  13. indirect=True,
  14. )
  15. def test_mmap(dut: Dut) -> None:
  16. dut.run_all_single_board_cases(group='mmu')
  17. # mmu tests with psram enabled
  18. PSRAM_RELEASE_CONFIGS = [
  19. pytest.param('psram_release_esp32', marks=[pytest.mark.esp32]),
  20. pytest.param('psram_release_esp32s2', marks=[pytest.mark.esp32s2]),
  21. pytest.param('psram_release_esp32s3', marks=[pytest.mark.esp32s3]),
  22. ]
  23. @pytest.mark.generic
  24. @pytest.mark.parametrize('config', PSRAM_RELEASE_CONFIGS, indirect=True)
  25. def test_mmap_psram(dut: Dut) -> None:
  26. dut.run_all_single_board_cases(group='mmu')
  27. # mmu tests with xip_psram
  28. XIP_CONFIGS = [
  29. pytest.param('xip_psram_esp32s2', marks=[pytest.mark.esp32s2]),
  30. pytest.param('xip_psram_esp32s3', marks=[pytest.mark.esp32s3]),
  31. ]
  32. @pytest.mark.generic
  33. @pytest.mark.parametrize('config', XIP_CONFIGS, indirect=True)
  34. def test_mmap_xip_psram(dut: Dut) -> None:
  35. dut.run_all_single_board_cases(group='mmu')
  36. # normal cache tests
  37. @pytest.mark.supported_targets
  38. @pytest.mark.generic
  39. @pytest.mark.parametrize(
  40. 'config',
  41. [
  42. 'release',
  43. ],
  44. indirect=True,
  45. )
  46. def test_cache(dut: Dut) -> None:
  47. dut.run_all_single_board_cases(group='cache')
  48. # cache tests with psram enabled
  49. @pytest.mark.generic
  50. @pytest.mark.parametrize('config', PSRAM_RELEASE_CONFIGS, indirect=True)
  51. def test_cache_psram(dut: Dut) -> None:
  52. dut.run_all_single_board_cases(group='cache')
  53. # cache tests with xip_psram
  54. @pytest.mark.generic
  55. @pytest.mark.parametrize('config', XIP_CONFIGS, indirect=True)
  56. def test_cache_xip_psram(dut: Dut) -> None:
  57. dut.run_all_single_board_cases(group='cache')