-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'test/improve_sdmmc_tests' into 'master'
sd: improve tests and added on CI See merge request espressif/esp-idf!27384
- Loading branch information
Showing
43 changed files
with
349 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
components/esp_driver_sdmmc/test_apps/sdmmc: | ||
disable: | ||
- if: SOC_SDMMC_HOST_SUPPORTED != 1 | ||
depends_components: | ||
- sdmmc | ||
- esp_driver_sdmmc |
9 changes: 9 additions & 0 deletions
9
...ents/esp_driver_sdmmc/test_apps/sd_test_utils/components/common_test_flows/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
set(srcs "sdmmc_test_cd_wp_common.c" "sdmmc_test_rw_common.c") | ||
|
||
set(public_include "include") | ||
|
||
idf_component_register( | ||
SRCS ${srcs} | ||
INCLUDE_DIRS ${public_include} | ||
PRIV_REQUIRES sdmmc unity test_utils | ||
) |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...omponents/sdmmc_test_board/CMakeLists.txt → ...mponents/sdmmc_test_boards/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
idf_component_register(SRCS sdmmc_test_board.c sdmmc_test_board_defs.c | ||
INCLUDE_DIRS include | ||
PRIV_REQUIRES sdmmc esp_driver_sdmmc esp_driver_sdspi) | ||
REQUIRES esp_driver_sdmmc esp_driver_sdspi esp_driver_gpio) |
File renamed without changes.
8 changes: 8 additions & 0 deletions
8
...esp_driver_sdmmc/test_apps/sd_test_utils/components/sdmmc_test_boards/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# SDMMC Test Boards | ||
|
||
This component is a test utility component for test board info: | ||
- SDMMC test boards (e.g. ESP32_WROVER_KIT, ESP32S3_USB_OTG, etc.) | ||
- eMMC test boards | ||
- SDMMC with SD breakout adapter board | ||
- SDSPI with SD breakout adapter board | ||
- ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
cmake_minimum_required(VERSION 3.16) | ||
|
||
list(APPEND EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components") | ||
list(APPEND EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/components/esp_driver_sdmmc/test_apps/sd_test_utils/components") | ||
set(COMPONENTS main) | ||
|
||
include($ENV{IDF_PATH}/tools/cmake/project.cmake) | ||
project(sdmmc_test_console) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
| Supported Targets | ESP32 | ESP32-P4 | ESP32-S3 | | ||
| ----------------- | ----- | -------- | -------- | |
20 changes: 20 additions & 0 deletions
20
components/esp_driver_sdmmc/test_apps/sdmmc/components/sdmmc_tests/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
set(srcs) | ||
|
||
|
||
if(CONFIG_SOC_SDMMC_HOST_SUPPORTED) | ||
list(APPEND srcs "sdmmc_test_begin_end_sd.c" | ||
"sdmmc_test_cd_wp_sd.c" | ||
"sdmmc_test_probe_sd.c" | ||
"sdmmc_test_rw_sd.c") | ||
endif() | ||
|
||
set(priv_requires "sdmmc" | ||
"esp_driver_sdmmc" | ||
"sdmmc_test_boards" | ||
"common_test_flows" | ||
"unity" | ||
) | ||
|
||
idf_component_register(SRCS ${srcs} | ||
PRIV_REQUIRES ${priv_requires} | ||
WHOLE_ARCHIVE TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
components/esp_driver_sdmmc/test_apps/sdmmc/main/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
set(srcs "test_app_main.c") | ||
|
||
set(priv_requires | ||
# tests reside in this component, also available for `sdmmc_console` | ||
sdmmc_tests | ||
# general | ||
unity | ||
) | ||
|
||
idf_component_register(SRCS ${srcs} | ||
INCLUDE_DIRS "." | ||
PRIV_REQUIRES ${priv_requires} | ||
WHOLE_ARCHIVE TRUE) |
43 changes: 43 additions & 0 deletions
43
components/esp_driver_sdmmc/test_apps/sdmmc/main/test_app_main.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: CC0-1.0 | ||
*/ | ||
|
||
#include "unity.h" | ||
#include "unity_test_utils.h" | ||
#include "esp_heap_caps.h" | ||
#include "sdkconfig.h" | ||
|
||
#define TEST_MEMORY_LEAK_THRESHOLD (300) | ||
|
||
void setUp(void) | ||
{ | ||
unity_utils_record_free_mem(); | ||
} | ||
|
||
void tearDown(void) | ||
{ | ||
unity_utils_evaluate_leaks_direct(TEST_MEMORY_LEAK_THRESHOLD); | ||
} | ||
|
||
void app_main(void) | ||
{ | ||
/* | ||
_____ _ ______________ ______ ________ | ||
|_ _| | | / ___| _ \ \/ || \/ / __ \ | ||
| | ___ ___| |_ \ `--.| | | | . . || . . | / \/ | ||
| |/ _ \/ __| __| `--. \ | | | |\/| || |\/| | | | ||
| | __/\__ \ |_ /\__/ / |/ /| | | || | | | \__/\ | ||
\_/\___||___/\__| \____/|___/ \_| |_/\_| |_/\____/ | ||
*/ | ||
|
||
printf(" _____ _ ______________ ______ ________\n"); | ||
printf("|_ _| | | / ___| _ \\ \\/ || \\/ / __ \\ \n"); | ||
printf(" | | ___ ___| |_ \\ `--.| | | | . . || . . | / \\/\n"); | ||
printf(" | |/ _ \\/ __| __| `--. \\ | | | |\\/| || |\\/| | |\n"); | ||
printf(" | | __/\\__ \\ |_ /\\__/ / |/ /| | | || | | | \\__/\\\n"); | ||
printf(" \\_/\\___||___/\\__| \\____/|___/ \\_| |_/\\_| |_/\\____/\n"); | ||
|
||
unity_run_menu(); | ||
} |
12 changes: 12 additions & 0 deletions
12
components/esp_driver_sdmmc/test_apps/sdmmc/pytest_sdmmc.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD | ||
# SPDX-License-Identifier: CC0-1.0 | ||
|
||
import pytest | ||
from pytest_embedded_idf import IdfDut | ||
|
||
|
||
@pytest.mark.esp32 | ||
@pytest.mark.esp32s3 | ||
@pytest.mark.sdcard | ||
def test_sdmmc(dut: IdfDut) -> None: | ||
dut.run_all_single_board_cases() |
2 changes: 2 additions & 0 deletions
2
components/esp_driver_sdmmc/test_apps/sdmmc/sdkconfig.defaults
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
CONFIG_FREERTOS_HZ=1000 | ||
CONFIG_ESP_TASK_WDT_EN=n |
Oops, something went wrong.