diff --git a/components/esp_driver_sdspi/test_apps/sdspi/components/sdspi_tests/sdmmc_test_probe_spi.c b/components/esp_driver_sdspi/test_apps/sdspi/components/sdspi_tests/sdmmc_test_probe_spi.c index 42da8c1e93..f765e52a65 100644 --- a/components/esp_driver_sdspi/test_apps/sdspi/components/sdspi_tests/sdmmc_test_probe_spi.c +++ b/components/esp_driver_sdspi/test_apps/sdspi/components/sdspi_tests/sdmmc_test_probe_spi.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -18,6 +18,7 @@ static void do_one_sdspi_probe(int slot, int freq_khz) sdmmc_card_print_info(stdout, &card); uint8_t* buffer = heap_caps_calloc(512, 1, MALLOC_CAP_DMA); TEST_ESP_OK(sdmmc_read_sectors(&card, buffer, 0, 1)); + free(buffer); sdmmc_test_spi_end(slot, &card); } @@ -32,21 +33,16 @@ TEST_CASE("sdspi probe, slot 0, HS", "[sdspi]") do_one_sdspi_probe(SLOT_0, SDMMC_FREQ_HIGHSPEED); } -#if !CONFIG_IDF_TARGET_ESP32 && !CONFIG_IDF_TARGET_ESP32S3 -//TODO: IDF-8750. Leaks too much memory, needs check TEST_CASE("sdspi probe, slot 1", "[sdspi]") { do_one_sdspi_probe(SLOT_1, SDMMC_FREQ_PROBING); do_one_sdspi_probe(SLOT_1, SDMMC_FREQ_DEFAULT); do_one_sdspi_probe(SLOT_1, SDMMC_FREQ_CUSTOM_10M); } -#endif -#if !CONFIG_IDF_TARGET_ESP32 && !CONFIG_IDF_TARGET_ESP32S3 -//TODO: IDF-8749 -//here freq should be changed to SDMMC_FREQ_HIGHSPEED after fixing IDF-8749 TEST_CASE("sdspi probe, slot 1, HS", "[sdspi]") { + //TODO: IDF-8749 + //here freq should be changed to SDMMC_FREQ_HIGHSPEED after fixing IDF-8749 do_one_sdspi_probe(SLOT_1, SDMMC_FREQ_DEFAULT); } -#endif diff --git a/components/esp_driver_sdspi/test_apps/sdspi/components/sdspi_tests/sdmmc_test_rw_spi.c b/components/esp_driver_sdspi/test_apps/sdspi/components/sdspi_tests/sdmmc_test_rw_spi.c index a45e5f0c13..916498b3c9 100644 --- a/components/esp_driver_sdspi/test_apps/sdspi/components/sdspi_tests/sdmmc_test_rw_spi.c +++ b/components/esp_driver_sdspi/test_apps/sdspi/components/sdspi_tests/sdmmc_test_rw_spi.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -26,14 +26,12 @@ TEST_CASE("sdspi read/write performance, slot 0", "[sdspi]") do_one_sdspi_perf_test(SLOT_0, SDMMC_FREQ_HIGHSPEED); } -#if !CONFIG_IDF_TARGET_ESP32 && !CONFIG_IDF_TARGET_ESP32S3 -//TODO: IDF-8749 -//here freq should be changed to SDMMC_FREQ_HIGHSPEED after fixing IDF-8749 TEST_CASE("sdspi read/write performance, slot 1", "[sdspi]") { + //TODO: IDF-8749 + //here freq should be changed to SDMMC_FREQ_HIGHSPEED after fixing IDF-8749 do_one_sdspi_perf_test(SLOT_1, SDMMC_FREQ_DEFAULT); } -#endif /* ========== Read/write tests with offset, SPI ========== */ @@ -52,14 +50,12 @@ TEST_CASE("sdspi read/write performance with offset, slot 0", "[sdspi]") do_one_sdspi_rw_test_with_offset(SLOT_0, SDMMC_FREQ_HIGHSPEED); } -#if !CONFIG_IDF_TARGET_ESP32 && !CONFIG_IDF_TARGET_ESP32S3 -//TODO: IDF-8749 -//here freq should be changed to SDMMC_FREQ_HIGHSPEED after fixing IDF-8749 TEST_CASE("sdspi read/write performance with offset, slot 1", "[sdspi]") { + //TODO: IDF-8749 + //here freq should be changed to SDMMC_FREQ_HIGHSPEED after fixing IDF-8749 do_one_sdspi_rw_test_with_offset(SLOT_1, SDMMC_FREQ_DEFAULT); } -#endif /* ========== Read/write tests with unaligned source/destination buffer, SPI ========== */ diff --git a/components/esp_driver_sdspi/test_apps/sdspi/main/test_app_main.c b/components/esp_driver_sdspi/test_apps/sdspi/main/test_app_main.c index 274579059d..b165025bc9 100644 --- a/components/esp_driver_sdspi/test_apps/sdspi/main/test_app_main.c +++ b/components/esp_driver_sdspi/test_apps/sdspi/main/test_app_main.c @@ -13,11 +13,13 @@ void setUp(void) { + printf("%s", ""); /* sneakily lazy-allocate the reent structure for this test task */ unity_utils_record_free_mem(); } void tearDown(void) { + esp_reent_cleanup(); unity_utils_evaluate_leaks_direct(TEST_MEMORY_LEAK_THRESHOLD); } diff --git a/components/esp_driver_sdspi/test_apps/sdspi/pytest_sdspi.py b/components/esp_driver_sdspi/test_apps/sdspi/pytest_sdspi.py index f2d30a8c2d..1364f7e91d 100644 --- a/components/esp_driver_sdspi/test_apps/sdspi/pytest_sdspi.py +++ b/components/esp_driver_sdspi/test_apps/sdspi/pytest_sdspi.py @@ -1,8 +1,7 @@ # SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: CC0-1.0 - from pytest_embedded_idf import IdfDut def test_sdspi(dut: IdfDut) -> None: - dut.run_all_single_board_cases() + dut.run_all_single_board_cases(reset=True)