unit-test: use TEST_GROUPS to filter tests for psram_vspi and psram_hspi

This commit is contained in:
Ivan Grokhotkov 2018-11-13 20:14:17 +08:00 committed by bot
parent 09e4321e97
commit 7b86247428
6 changed files with 26 additions and 49 deletions

View file

@ -1,11 +1,4 @@
if (CONFIG_TEST_ESP32_SUBTEST_ONLY)
set(COMPONENT_SRCDIRS "psram_4m")
set(COMPONENT_ADD_INCLUDEDIRS ".")
register_component()
else()
set(COMPONENT_SRCDIRS ". psram_4m")
set(COMPONENT_SRCDIRS ".")
set(COMPONENT_ADD_INCLUDEDIRS ". ${CMAKE_CURRENT_BINARY_DIR}")
set(COMPONENT_REQUIRES unity nvs_flash ulp)
@ -35,4 +28,3 @@ else()
add_custom_target(esp32_test_logo DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/test_tjpgd_logo.h")
add_dependencies(${COMPONENT_NAME} esp32_test_logo)
endif()

View file

@ -6,11 +6,7 @@ COMPONENT_EXTRA_CLEAN := test_tjpgd_logo.h
COMPONENT_ADD_LDFLAGS = -Wl,--whole-archive -l$(COMPONENT_NAME) -Wl,--no-whole-archive
ifdef CONFIG_TEST_ESP32_SUBTEST_ONLY
COMPONENT_SRCDIRS := psram_4m
else
COMPONENT_SRCDIRS := . test_vectors psram_4m
endif
COMPONENT_SRCDIRS := .
# 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)\"

View file

@ -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
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;
#if !CONFIG_SPIRAM_SUPPORT || !CONFIG_SPIRAM_SPEED_80M || CONFIG_SPIRAM_BANKSWITCH_ENABLE

View file

@ -13,14 +13,3 @@ config UNITY_FREERTOS_STACK_SIZE
default 8192
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

View file

@ -1,5 +1,5 @@
TEST_COMPONENTS=esp32
CONFIG_TEST_ESP32_SUBTEST_ONLY=y
TEST_GROUPS=psram_4m
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
CONFIG_SPIRAM_SUPPORT=y
CONFIG_SPIRAM_SPEED_80M=y

View file

@ -1,5 +1,5 @@
TEST_COMPONENTS=esp32
CONFIG_TEST_ESP32_SUBTEST_ONLY=y
TEST_GROUPS=psram_4m
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
CONFIG_SPIRAM_SUPPORT=y
CONFIG_SPIRAM_SPEED_80M=y