]> granicus.if.org Git - esp-idf/commitdiff
unit-test: use TEST_GROUPS to filter tests for psram_vspi and psram_hspi
authorIvan Grokhotkov <ivan@espressif.com>
Tue, 13 Nov 2018 12:14:17 +0000 (20:14 +0800)
committerbot <bot@espressif.com>
Thu, 15 Nov 2018 12:27:05 +0000 (12:27 +0000)
components/esp32/test/CMakeLists.txt
components/esp32/test/component.mk
components/esp32/test/test_4mpsram.c [moved from components/esp32/test/psram_4m/test_4mpsram.c with 96% similarity]
tools/unit-test-app/components/unity/Kconfig
tools/unit-test-app/configs/psram_hspi
tools/unit-test-app/configs/psram_vspi

index baaa34309b686512bbccda3d4aef564ea5cde64c..6479bbcf78f9e8448e1b81dc32d08c10e4faf305 100644 (file)
@@ -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()
\ No newline at end of file
+add_dependencies(${COMPONENT_NAME} esp32_test_logo)
index 41947b1b7c54acc655a463bbc111a03127c5110b..11e0f7ed7c430a0b56c2af386667fe7a5dad137a 100644 (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)\"
similarity index 96%
rename from components/esp32/test/psram_4m/test_4mpsram.c
rename to components/esp32/test/test_4mpsram.c
index 29aef654e7d4d989f7c1f4e502e079cc0775e661..26e2c8d5e4d5b33a7d89f09b52c4258424b49027 100644 (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
index 02ffde126bf40d19935427429f5eab439b24686b..642d76f9d5a6c81780a5428d25cdc5ea82cf1007 100644 (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
index 1e4583c1f2984fbb016a9328686ab0626f57f5c6..d8568109d4e0101c7d6f33f060e0a1c7bf2ae0ce 100644 (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
index 73bbd4868c8804e6914150c53eb72ba0e5e5ee3a..afa0c28f184977af1040c48914d1256844e0014b 100644 (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