2024-04-09 03:02:05 -04:00
|
|
|
# SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
2023-06-20 06:00:26 -04:00
|
|
|
# SPDX-License-Identifier: Unlicense OR CC0-1.0
|
|
|
|
import pytest
|
|
|
|
from pytest_embedded import Dut
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.supported_targets
|
2024-06-27 08:19:49 -04:00
|
|
|
@pytest.mark.temp_skip_ci(targets=['esp32c5'], reason='not support yet') # TODO: [ESP32C5] IDF-8704, IDF-10314
|
2023-06-20 06:00:26 -04:00
|
|
|
@pytest.mark.generic
|
|
|
|
@pytest.mark.parametrize(
|
|
|
|
'config',
|
|
|
|
[
|
|
|
|
'spiflash'
|
|
|
|
],
|
|
|
|
indirect=True
|
|
|
|
)
|
|
|
|
def test_examples_perf_benchmark_spiflash(dut: Dut) -> None:
|
|
|
|
# SPI flash
|
|
|
|
dut.expect('example: Mountig WL layer...', timeout=10)
|
|
|
|
dut.expect('example: WL layer mounted', timeout=90)
|
|
|
|
dut.expect('example: WL layer unmounted', timeout=240) # SPI flash has slow write speed
|
|
|
|
|
|
|
|
dut.expect('example: FATFS mounted to', timeout=90) # Increased timeout due to formatting
|
|
|
|
dut.expect('example: FATFS partition unmounted', timeout=240) # SPI flash has slow write speed
|
|
|
|
|
|
|
|
dut.expect('example: SPIFFS mounted to', timeout=90) # Increased timeout due to formatting
|
|
|
|
dut.expect('example: SPIFFS partition unmounted', timeout=240) # SPI flash has slow write speed
|
|
|
|
|
2024-04-09 03:02:05 -04:00
|
|
|
dut.expect('example: LittleFS mounted to', timeout=90) # Increased timeout due to formatting
|
|
|
|
dut.expect('example: LittleFS partition unmounted', timeout=240) # SPI flash has slow write speed
|
|
|
|
|
2023-06-20 06:00:26 -04:00
|
|
|
|
|
|
|
@pytest.mark.esp32
|
|
|
|
@pytest.mark.sdcard_sdmode
|
|
|
|
@pytest.mark.parametrize(
|
|
|
|
'config',
|
|
|
|
[
|
|
|
|
'sdmmc_1line',
|
|
|
|
'sdmmc_4line',
|
|
|
|
],
|
|
|
|
indirect=True,
|
|
|
|
)
|
|
|
|
def test_examples_perf_benchmark_sdcard_sdmmc(dut: Dut) -> None:
|
|
|
|
# SD card
|
|
|
|
dut.expect('example: Mounting SD card - raw access', timeout=10)
|
2024-04-09 03:02:05 -04:00
|
|
|
dut.expect('sd_utils: SD card mounted - raw access', timeout=10)
|
2023-06-20 06:00:26 -04:00
|
|
|
dut.expect('example: SD card unmounted - raw access', timeout=60)
|
|
|
|
|
|
|
|
dut.expect('example: SD card mounted - FATFS', timeout=120) # Increased timeout due to formatting
|
|
|
|
dut.expect('example: SD card unmounted - FATFS', timeout=180)
|
|
|
|
|
2024-04-09 03:02:05 -04:00
|
|
|
dut.expect('example: SD card mounted - LittleFS', timeout=120) # Increased timeout due to formatting
|
|
|
|
dut.expect('example: SD card unmounted - LittleFS', timeout=180)
|
|
|
|
|
2023-06-20 06:00:26 -04:00
|
|
|
|
|
|
|
@pytest.mark.esp32
|
2024-03-04 22:38:30 -05:00
|
|
|
@pytest.mark.temp_skip_ci(targets=['esp32'], reason='IDFCI-2059, temporary lack runner')
|
2023-06-20 06:00:26 -04:00
|
|
|
@pytest.mark.esp32c3
|
2023-10-06 05:35:44 -04:00
|
|
|
@pytest.mark.esp32s2
|
2023-06-20 06:00:26 -04:00
|
|
|
@pytest.mark.sdcard_spimode
|
|
|
|
@pytest.mark.parametrize(
|
|
|
|
'config',
|
|
|
|
[
|
|
|
|
'sdspi_1line',
|
|
|
|
],
|
|
|
|
indirect=True,
|
|
|
|
)
|
|
|
|
def test_examples_perf_benchmark_sdcard_spi(dut: Dut) -> None:
|
|
|
|
# SD card
|
|
|
|
dut.expect('example: Mounting SD card - raw access', timeout=10)
|
2024-04-09 03:02:05 -04:00
|
|
|
dut.expect('sd_utils: SD card mounted - raw access', timeout=10)
|
2023-06-20 06:00:26 -04:00
|
|
|
dut.expect('example: SD card unmounted - raw access', timeout=180)
|
|
|
|
|
|
|
|
dut.expect('example: SD card mounted - FATFS', timeout=120) # Increased timeout due to formatting
|
|
|
|
dut.expect('example: SD card unmounted - FATFS', timeout=180)
|
2024-04-09 03:02:05 -04:00
|
|
|
|
|
|
|
dut.expect('example: SD card mounted - LittleFS', timeout=120) # Increased timeout due to formatting
|
|
|
|
dut.expect('example: SD card unmounted - LittleFS', timeout=180)
|