Bladeren bron

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

Ivan Grokhotkov 7 jaren geleden
bovenliggende
commit
7b86247428

+ 22 - 30
components/esp32/test/CMakeLists.txt

@@ -1,38 +1,30 @@
-if (CONFIG_TEST_ESP32_SUBTEST_ONLY)
-    set(COMPONENT_SRCDIRS "psram_4m")
-    set(COMPONENT_ADD_INCLUDEDIRS ".")
+set(COMPONENT_SRCDIRS ".")
+set(COMPONENT_ADD_INCLUDEDIRS ". ${CMAKE_CURRENT_BINARY_DIR}")
 
-    register_component()
+set(COMPONENT_REQUIRES unity nvs_flash ulp)
 
-else()
-    set(COMPONENT_SRCDIRS ". psram_4m")
-    set(COMPONENT_ADD_INCLUDEDIRS ". ${CMAKE_CURRENT_BINARY_DIR}")
+register_component()
 
-    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"
-                    COMMAND xxd -i "logo.jpg" "${CMAKE_CURRENT_BINARY_DIR}/test_tjpgd_logo.h"
-                    WORKING_DIRECTORY ${COMPONENT_PATH}
-                    DEPENDS "${CMAKE_CURRENT_LIST_DIR}/logo.jpg")
+# Calculate MD5 value of header file esp_wifi_crypto_types.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)
 
-    # 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_definitions(-DWIFI_OS_ADAPTER_MD5=\"${WIFI_OS_ADAPTER_MD5}\")
+add_definitions(-DWIFI_CRYPTO_MD5=\"${WIFI_CRYPTO_MD5}\")
 
-    # Calculate MD5 value of header file esp_wifi_crypto_types.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_custom_target(esp32_test_logo DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/test_tjpgd_logo.h")
 
-    add_definitions(-DWIFI_OS_ADAPTER_MD5=\"${WIFI_OS_ADAPTER_MD5}\")
-    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()
+add_dependencies(${COMPONENT_NAME} esp32_test_logo)

+ 1 - 5
components/esp32/test/component.mk

@@ -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)\"

+ 1 - 1
components/esp32/test/psram_4m/test_4mpsram.c → components/esp32/test/test_4mpsram.c

@@ -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

+ 0 - 11
tools/unit-test-app/components/unity/Kconfig

@@ -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

+ 1 - 1
tools/unit-test-app/configs/psram_hspi

@@ -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

+ 1 - 1
tools/unit-test-app/configs/psram_vspi

@@ -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