kopia lustrzana https://github.com/espressif/esp-idf
unit-test: use TEST_GROUPS to filter tests for psram_vspi and psram_hspi
rodzic
09e4321e97
commit
7b86247428
|
@ -1,38 +1,30 @@
|
||||||
if (CONFIG_TEST_ESP32_SUBTEST_ONLY)
|
set(COMPONENT_SRCDIRS ".")
|
||||||
set(COMPONENT_SRCDIRS "psram_4m")
|
set(COMPONENT_ADD_INCLUDEDIRS ". ${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
set(COMPONENT_ADD_INCLUDEDIRS ".")
|
|
||||||
|
|
||||||
register_component()
|
set(COMPONENT_REQUIRES unity nvs_flash ulp)
|
||||||
|
|
||||||
else()
|
register_component()
|
||||||
set(COMPONENT_SRCDIRS ". psram_4m")
|
|
||||||
set(COMPONENT_ADD_INCLUDEDIRS ". ${CMAKE_CURRENT_BINARY_DIR}")
|
|
||||||
|
|
||||||
set(COMPONENT_REQUIRES unity nvs_flash ulp)
|
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/test_tjpgd_logo.h"
|
||||||
|
COMMAND xxd -i "logo.jpg" "${CMAKE_CURRENT_BINARY_DIR}/test_tjpgd_logo.h"
|
||||||
|
WORKING_DIRECTORY ${COMPONENT_PATH}
|
||||||
|
DEPENDS "${CMAKE_CURRENT_LIST_DIR}/logo.jpg")
|
||||||
|
|
||||||
register_component()
|
# Calculate MD5 value of header file esp_wifi_os_adapter.h
|
||||||
|
execute_process(COMMAND md5sum ${IDF_PATH}/components/esp32/include/esp_wifi_os_adapter.h
|
||||||
|
COMMAND cut -c 1-7
|
||||||
|
OUTPUT_VARIABLE WIFI_OS_ADAPTER_MD5
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/test_tjpgd_logo.h"
|
# Calculate MD5 value of header file esp_wifi_crypto_types.h
|
||||||
COMMAND xxd -i "logo.jpg" "${CMAKE_CURRENT_BINARY_DIR}/test_tjpgd_logo.h"
|
execute_process(COMMAND md5sum ${IDF_PATH}/components/esp32/include/esp_wifi_crypto_types.h
|
||||||
WORKING_DIRECTORY ${COMPONENT_PATH}
|
COMMAND cut -c 1-7
|
||||||
DEPENDS "${CMAKE_CURRENT_LIST_DIR}/logo.jpg")
|
OUTPUT_VARIABLE WIFI_CRYPTO_MD5
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
# Calculate MD5 value of header file esp_wifi_os_adapter.h
|
add_definitions(-DWIFI_OS_ADAPTER_MD5=\"${WIFI_OS_ADAPTER_MD5}\")
|
||||||
execute_process(COMMAND md5sum ${IDF_PATH}/components/esp32/include/esp_wifi_os_adapter.h
|
add_definitions(-DWIFI_CRYPTO_MD5=\"${WIFI_CRYPTO_MD5}\")
|
||||||
COMMAND cut -c 1-7
|
|
||||||
OUTPUT_VARIABLE WIFI_OS_ADAPTER_MD5
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
||||||
|
|
||||||
# Calculate MD5 value of header file esp_wifi_crypto_types.h
|
add_custom_target(esp32_test_logo DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/test_tjpgd_logo.h")
|
||||||
execute_process(COMMAND md5sum ${IDF_PATH}/components/esp32/include/esp_wifi_crypto_types.h
|
|
||||||
COMMAND cut -c 1-7
|
|
||||||
OUTPUT_VARIABLE WIFI_CRYPTO_MD5
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
||||||
|
|
||||||
add_definitions(-DWIFI_OS_ADAPTER_MD5=\"${WIFI_OS_ADAPTER_MD5}\")
|
add_dependencies(${COMPONENT_NAME} esp32_test_logo)
|
||||||
add_definitions(-DWIFI_CRYPTO_MD5=\"${WIFI_CRYPTO_MD5}\")
|
|
||||||
|
|
||||||
add_custom_target(esp32_test_logo DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/test_tjpgd_logo.h")
|
|
||||||
|
|
||||||
add_dependencies(${COMPONENT_NAME} esp32_test_logo)
|
|
||||||
endif()
|
|
||||||
|
|
|
@ -6,11 +6,7 @@ COMPONENT_EXTRA_CLEAN := test_tjpgd_logo.h
|
||||||
|
|
||||||
COMPONENT_ADD_LDFLAGS = -Wl,--whole-archive -l$(COMPONENT_NAME) -Wl,--no-whole-archive
|
COMPONENT_ADD_LDFLAGS = -Wl,--whole-archive -l$(COMPONENT_NAME) -Wl,--no-whole-archive
|
||||||
|
|
||||||
ifdef CONFIG_TEST_ESP32_SUBTEST_ONLY
|
COMPONENT_SRCDIRS := .
|
||||||
COMPONENT_SRCDIRS := psram_4m
|
|
||||||
else
|
|
||||||
COMPONENT_SRCDIRS := . test_vectors psram_4m
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Calculate MD5 value of header file esp_wifi_os_adapter.h
|
# Calculate MD5 value of header file esp_wifi_os_adapter.h
|
||||||
WIFI_OS_ADAPTER_MD5_VAL=\"$(shell md5sum $(IDF_PATH)/components/esp32/include/esp_wifi_os_adapter.h | cut -c 1-7)\"
|
WIFI_OS_ADAPTER_MD5_VAL=\"$(shell md5sum $(IDF_PATH)/components/esp32/include/esp_wifi_os_adapter.h | cut -c 1-7)\"
|
||||||
|
|
|
@ -34,7 +34,7 @@ static void test_psram_content()
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: this unit test rely on the config that PSRAM of 8MB is used only when CONFIG_SPIRAM_BNKSWITCH_ENABLE is set
|
// NOTE: this unit test rely on the config that PSRAM of 8MB is used only when CONFIG_SPIRAM_BNKSWITCH_ENABLE is set
|
||||||
TEST_CASE("can use spi when not being used by psram", "[esp32]")
|
TEST_CASE("can use spi when not being used by psram", "[psram_4m]")
|
||||||
{
|
{
|
||||||
spi_host_device_t host;
|
spi_host_device_t host;
|
||||||
#if !CONFIG_SPIRAM_SUPPORT || !CONFIG_SPIRAM_SPEED_80M || CONFIG_SPIRAM_BANKSWITCH_ENABLE
|
#if !CONFIG_SPIRAM_SUPPORT || !CONFIG_SPIRAM_SPEED_80M || CONFIG_SPIRAM_BANKSWITCH_ENABLE
|
|
@ -13,14 +13,3 @@ config UNITY_FREERTOS_STACK_SIZE
|
||||||
default 8192
|
default 8192
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
menu "Test options"
|
|
||||||
|
|
||||||
config TEST_ESP32_SUBTEST_ONLY
|
|
||||||
bool "Test only 4M PSRAM cases for esp32 component"
|
|
||||||
depends on SPIRAM_SUPPORT
|
|
||||||
default n
|
|
||||||
help
|
|
||||||
If this option is enabled, only 4M PSRAM cases are compiled. Otherwise all cases are included.
|
|
||||||
|
|
||||||
endmenu
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
TEST_COMPONENTS=esp32
|
TEST_COMPONENTS=esp32
|
||||||
CONFIG_TEST_ESP32_SUBTEST_ONLY=y
|
TEST_GROUPS=psram_4m
|
||||||
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
|
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
|
||||||
CONFIG_SPIRAM_SUPPORT=y
|
CONFIG_SPIRAM_SUPPORT=y
|
||||||
CONFIG_SPIRAM_SPEED_80M=y
|
CONFIG_SPIRAM_SPEED_80M=y
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
TEST_COMPONENTS=esp32
|
TEST_COMPONENTS=esp32
|
||||||
CONFIG_TEST_ESP32_SUBTEST_ONLY=y
|
TEST_GROUPS=psram_4m
|
||||||
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
|
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
|
||||||
CONFIG_SPIRAM_SUPPORT=y
|
CONFIG_SPIRAM_SUPPORT=y
|
||||||
CONFIG_SPIRAM_SPEED_80M=y
|
CONFIG_SPIRAM_SPEED_80M=y
|
||||||
|
|
Ładowanie…
Reference in New Issue