app_test.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
  2. # SPDX-License-Identifier: Apache-2.0
  3. import glob
  4. import os
  5. from typing import Any
  6. import ttfw_idf
  7. from tiny_test_fw import Utility
  8. def test_loop(env, config_names): # type: (Any, Any) -> None
  9. for name in config_names:
  10. Utility.console_log("Checking config \"{}\"... ".format(name), end='')
  11. dut = env.get_dut('flash_psram', 'tools/test_apps/system/flash_psram', app_config_name=name)
  12. dut.start_app()
  13. dut.expect('flash psram test success')
  14. env.close_dut(dut.name)
  15. Utility.console_log('done')
  16. # For F8R8 board (Octal Flash and Octal PSRAM)
  17. @ttfw_idf.idf_custom_test(env_tag='MSPI_F8R8', target=['esp32s3'])
  18. def test_flash8_psram8(env, _): # type: (Any, Any) -> None
  19. config_files = glob.glob(os.path.join(os.path.dirname(__file__), 'sdkconfig.ci.f8r8*'))
  20. config_names = [os.path.basename(s).replace('sdkconfig.ci.', '') for s in config_files]
  21. test_loop(env, config_names)
  22. # For F4R8 board (Quad Flash and Octal PSRAM)
  23. @ttfw_idf.idf_custom_test(env_tag='MSPI_F4R8', target=['esp32s3'])
  24. def test_flash4_psram8(env, _): # type: (Any, Any) -> None
  25. config_files = glob.glob(os.path.join(os.path.dirname(__file__), 'sdkconfig.ci.f4r8*'))
  26. config_names = [os.path.basename(s).replace('sdkconfig.ci.', '') for s in config_files]
  27. test_loop(env, config_names)
  28. # For F4R4 board (Quad Flash and Quad PSRAM)
  29. @ttfw_idf.idf_custom_test(env_tag='MSPI_F4R4', target=['esp32s3'])
  30. def test_flash4_psram4(env, _): # type: (Any, Any) -> None
  31. config_files = glob.glob(os.path.join(os.path.dirname(__file__), 'sdkconfig.ci.f4r4*'))
  32. config_names = [os.path.basename(s).replace('sdkconfig.ci.', '') for s in config_files]
  33. test_loop(env, config_names)
  34. if __name__ == '__main__':
  35. test_flash8_psram8()
  36. test_flash4_psram8()
  37. test_flash4_psram4()