From 287bdc5e61935bade4969b82017e9a484ab68711 Mon Sep 17 00:00:00 2001 From: Darian Leung Date: Wed, 6 Sep 2023 11:31:01 +0800 Subject: [PATCH] fix(test_apps): Trim builds of component test apps Some component test apps do not use the "set(COMPONENTS main)" command in their project level "CMakeLists.txt", thus leading to their builds pulling in all ESP-IDF components. This commit trims the build of multiple component test apps: - Add "set(COMPONENTS main ...)" to project level "CMakeLists.txt" - Add missing "PRIV_REQUIRES" in some "main" component "CMakeLists.txt" Also removed repeated configuraiton options in legacy_i2c_driver/sdkconfig.ci.defaults as they are already specified in legacy_i2c_driver/sdkconfig.defaults --- .../legacy_i2c_driver/CMakeLists.txt | 4 +++ .../legacy_i2c_driver/main/CMakeLists.txt | 1 + .../legacy_i2c_driver/sdkconfig.ci.defaults | 2 -- .../test_apps/dma/CMakeLists.txt | 5 +++ .../test_apps/dma/main/CMakeLists.txt | 1 + .../test_apps/etm/CMakeLists.txt | 5 +++ .../test_apps/etm/main/CMakeLists.txt | 1 + .../test_apps/mspi/CMakeLists.txt | 5 +++ .../test_apps/mspi/main/CMakeLists.txt | 1 + .../mspi_psram_with_dfs/CMakeLists.txt | 8 +++++ .../mspi_psram_with_dfs/main/CMakeLists.txt | 1 + .../test_apps/i2c_lcd_legacy/CMakeLists.txt | 4 +++ .../i2c_lcd_legacy/main/CMakeLists.txt | 1 + components/esp_mm/test_apps/mm/CMakeLists.txt | 4 +++ .../esp_mm/test_apps/mmap_hw/CMakeLists.txt | 3 ++ .../test_app_esp_netif/CMakeLists.txt | 3 ++ .../test_app_vfs_l2tap/CMakeLists.txt | 3 ++ .../esp_psram/test_apps/psram/CMakeLists.txt | 4 +++ .../test_apps/psram/main/CMakeLists.txt | 1 + .../test_apps/wifi_connect/CMakeLists.txt | 3 ++ .../test_apps/wifi_function/CMakeLists.txt | 3 ++ .../test_apps/freertos/CMakeLists.txt | 32 +++++++++---------- .../test_apps/freertos/main/CMakeLists.txt | 3 +- .../test_apps/freertos/misc/CMakeLists.txt | 2 +- .../freertos/performance/CMakeLists.txt | 2 +- .../test_apps/freertos/port/CMakeLists.txt | 2 +- .../test_apps/test_ieee802154/CMakeLists.txt | 4 +++ .../test_ieee802154/main/CMakeLists.txt | 1 + .../test_apps/esp_flash/CMakeLists.txt | 4 +++ .../test_apps/esp_flash/main/CMakeLists.txt | 1 + .../test_apps/esp_flash_stress/CMakeLists.txt | 4 +++ .../test_apps/flash_encryption/CMakeLists.txt | 5 +++ .../flash_encryption/main/CMakeLists.txt | 1 + .../test_apps/flash_mmap/CMakeLists.txt | 4 +++ .../test_apps/flash_mmap/main/CMakeLists.txt | 1 + .../test_apps/flash_suspend/CMakeLists.txt | 3 ++ .../flash_suspend/main/CMakeLists.txt | 1 + .../test_apps/mspi_test/CMakeLists.txt | 4 +++ .../test_apps/mspi_test/main/CMakeLists.txt | 1 + .../ulp/test_apps/lp_core/CMakeLists.txt | 3 ++ .../ulp/test_apps/ulp_riscv/CMakeLists.txt | 3 ++ components/usb/test_apps/hcd/CMakeLists.txt | 5 +++ .../usb/test_apps/usb_host/CMakeLists.txt | 5 +++ 43 files changed, 132 insertions(+), 22 deletions(-) diff --git a/components/driver/test_apps/legacy_i2c_driver/CMakeLists.txt b/components/driver/test_apps/legacy_i2c_driver/CMakeLists.txt index 1864548037b..7f6a4ab7bc6 100644 --- a/components/driver/test_apps/legacy_i2c_driver/CMakeLists.txt +++ b/components/driver/test_apps/legacy_i2c_driver/CMakeLists.txt @@ -5,6 +5,10 @@ set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components" ) +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. We also depend on esp_pm +# as we set CONFIG_PM_... options. +set(COMPONENTS main esp_pm) + include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(legacy_i2c_test) diff --git a/components/driver/test_apps/legacy_i2c_driver/main/CMakeLists.txt b/components/driver/test_apps/legacy_i2c_driver/main/CMakeLists.txt index 23741b95bc2..008413a5677 100644 --- a/components/driver/test_apps/legacy_i2c_driver/main/CMakeLists.txt +++ b/components/driver/test_apps/legacy_i2c_driver/main/CMakeLists.txt @@ -3,4 +3,5 @@ set(srcs "test_app_main.c" ) idf_component_register(SRCS ${srcs} + PRIV_REQUIRES unity test_utils driver WHOLE_ARCHIVE) diff --git a/components/driver/test_apps/legacy_i2c_driver/sdkconfig.ci.defaults b/components/driver/test_apps/legacy_i2c_driver/sdkconfig.ci.defaults index b308cb2ddda..e69de29bb2d 100644 --- a/components/driver/test_apps/legacy_i2c_driver/sdkconfig.ci.defaults +++ b/components/driver/test_apps/legacy_i2c_driver/sdkconfig.ci.defaults @@ -1,2 +0,0 @@ -CONFIG_FREERTOS_HZ=1000 -CONFIG_ESP_TASK_WDT=n diff --git a/components/esp_hw_support/test_apps/dma/CMakeLists.txt b/components/esp_hw_support/test_apps/dma/CMakeLists.txt index e87048a2116..42e63786a1c 100644 --- a/components/esp_hw_support/test_apps/dma/CMakeLists.txt +++ b/components/esp_hw_support/test_apps/dma/CMakeLists.txt @@ -2,4 +2,9 @@ cmake_minimum_required(VERSION 3.16) include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. We also depend on esp_psram +# as we set CONFIG_SPIRAM_... options. +set(COMPONENTS main esp_psram) + project(dma_test) diff --git a/components/esp_hw_support/test_apps/dma/main/CMakeLists.txt b/components/esp_hw_support/test_apps/dma/main/CMakeLists.txt index 0fb8a69f509..4088442971e 100644 --- a/components/esp_hw_support/test_apps/dma/main/CMakeLists.txt +++ b/components/esp_hw_support/test_apps/dma/main/CMakeLists.txt @@ -11,4 +11,5 @@ endif() # In order for the cases defined by `TEST_CASE` to be linked into the final elf, # the component can be registered as WHOLE_ARCHIVE idf_component_register(SRCS ${srcs} + PRIV_REQUIRES unity WHOLE_ARCHIVE) diff --git a/components/esp_hw_support/test_apps/etm/CMakeLists.txt b/components/esp_hw_support/test_apps/etm/CMakeLists.txt index d5c75a52b3a..0d009db6795 100644 --- a/components/esp_hw_support/test_apps/etm/CMakeLists.txt +++ b/components/esp_hw_support/test_apps/etm/CMakeLists.txt @@ -2,4 +2,9 @@ cmake_minimum_required(VERSION 3.16) include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. We also depend on esp_pm +# as we set CONFIG_PM_... options. +set(COMPONENTS main esp_pm) + project(etm_test) diff --git a/components/esp_hw_support/test_apps/etm/main/CMakeLists.txt b/components/esp_hw_support/test_apps/etm/main/CMakeLists.txt index e824508d65e..14c910836c8 100644 --- a/components/esp_hw_support/test_apps/etm/main/CMakeLists.txt +++ b/components/esp_hw_support/test_apps/etm/main/CMakeLists.txt @@ -24,4 +24,5 @@ endif() # In order for the cases defined by `TEST_CASE` to be linked into the final elf, # the component can be registered as WHOLE_ARCHIVE idf_component_register(SRCS ${srcs} + PRIV_REQUIRES unity esp_timer driver WHOLE_ARCHIVE) diff --git a/components/esp_hw_support/test_apps/mspi/CMakeLists.txt b/components/esp_hw_support/test_apps/mspi/CMakeLists.txt index ecada2191fe..af6aff96e79 100644 --- a/components/esp_hw_support/test_apps/mspi/CMakeLists.txt +++ b/components/esp_hw_support/test_apps/mspi/CMakeLists.txt @@ -2,4 +2,9 @@ cmake_minimum_required(VERSION 3.16) include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. We also depend on esp_psram +# as we set CONFIG_SPIRAM_... options. +set(COMPONENTS main esp_psram) + project(mspi_test_app) diff --git a/components/esp_hw_support/test_apps/mspi/main/CMakeLists.txt b/components/esp_hw_support/test_apps/mspi/main/CMakeLists.txt index 8d30280ddbb..f2dc595cbc6 100644 --- a/components/esp_hw_support/test_apps/mspi/main/CMakeLists.txt +++ b/components/esp_hw_support/test_apps/mspi/main/CMakeLists.txt @@ -7,4 +7,5 @@ set(srcs # In order for the cases defined by `TEST_CASE` to be linked into the final elf, # the component can be registered as WHOLE_ARCHIVE idf_component_register(SRCS ${srcs} + PRIV_REQUIRES unity esp_timer spi_flash esp_partition WHOLE_ARCHIVE) diff --git a/components/esp_hw_support/test_apps/mspi_psram_with_dfs/CMakeLists.txt b/components/esp_hw_support/test_apps/mspi_psram_with_dfs/CMakeLists.txt index 493e4aa2edd..75826523ecf 100644 --- a/components/esp_hw_support/test_apps/mspi_psram_with_dfs/CMakeLists.txt +++ b/components/esp_hw_support/test_apps/mspi_psram_with_dfs/CMakeLists.txt @@ -2,4 +2,12 @@ cmake_minimum_required(VERSION 3.16) include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +list(APPEND EXTRA_COMPONENT_DIRS + "$ENV{IDF_PATH}/tools/unit-test-app/components") # For test_utils component + +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. We also depend on +# esptool_py and esp_psram as we set CONFIG_ESPTOOLPY_... and CONFIG_SPIRAM_... options. +set(COMPONENTS main esptool_py esp_psram) + project(mspi_psram_test_app) diff --git a/components/esp_hw_support/test_apps/mspi_psram_with_dfs/main/CMakeLists.txt b/components/esp_hw_support/test_apps/mspi_psram_with_dfs/main/CMakeLists.txt index a26b8b7aee6..1136a2b2378 100644 --- a/components/esp_hw_support/test_apps/mspi_psram_with_dfs/main/CMakeLists.txt +++ b/components/esp_hw_support/test_apps/mspi_psram_with_dfs/main/CMakeLists.txt @@ -6,4 +6,5 @@ set(srcs # In order for the cases defined by `TEST_CASE` to be linked into the final elf, # the component can be registered as WHOLE_ARCHIVE idf_component_register(SRCS ${srcs} + PRIV_REQUIRES unity test_utils spi_flash esp_partition esp_pm WHOLE_ARCHIVE) diff --git a/components/esp_lcd/test_apps/i2c_lcd_legacy/CMakeLists.txt b/components/esp_lcd/test_apps/i2c_lcd_legacy/CMakeLists.txt index 9c62f764dc1..8c099ff31c5 100644 --- a/components/esp_lcd/test_apps/i2c_lcd_legacy/CMakeLists.txt +++ b/components/esp_lcd/test_apps/i2c_lcd_legacy/CMakeLists.txt @@ -2,4 +2,8 @@ cmake_minimum_required(VERSION 3.16) include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) + project(legacy_i2c_lcd_panel_test) diff --git a/components/esp_lcd/test_apps/i2c_lcd_legacy/main/CMakeLists.txt b/components/esp_lcd/test_apps/i2c_lcd_legacy/main/CMakeLists.txt index b969d9dbf92..a168fe90a07 100644 --- a/components/esp_lcd/test_apps/i2c_lcd_legacy/main/CMakeLists.txt +++ b/components/esp_lcd/test_apps/i2c_lcd_legacy/main/CMakeLists.txt @@ -4,4 +4,5 @@ set(srcs "test_app_main.c" # In order for the cases defined by `TEST_CASE` to be linked into the final elf, # the component can be registered as WHOLE_ARCHIVE idf_component_register(SRCS ${srcs} + PRIV_REQUIRES unity driver esp_lcd WHOLE_ARCHIVE) diff --git a/components/esp_mm/test_apps/mm/CMakeLists.txt b/components/esp_mm/test_apps/mm/CMakeLists.txt index e349686fc1f..3e976ca666d 100644 --- a/components/esp_mm/test_apps/mm/CMakeLists.txt +++ b/components/esp_mm/test_apps/mm/CMakeLists.txt @@ -3,6 +3,10 @@ cmake_minimum_required(VERSION 3.16) set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/components/esp_mm/test_apps/components") +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. We also depend on esp_psram +# as we set CONFIG_SPIRAM_... options. +set(COMPONENTS main esp_psram) + include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(mm_test) diff --git a/components/esp_mm/test_apps/mmap_hw/CMakeLists.txt b/components/esp_mm/test_apps/mmap_hw/CMakeLists.txt index d1e1dbc25f5..fac8366284b 100644 --- a/components/esp_mm/test_apps/mmap_hw/CMakeLists.txt +++ b/components/esp_mm/test_apps/mmap_hw/CMakeLists.txt @@ -3,6 +3,9 @@ cmake_minimum_required(VERSION 3.16) set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components") +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) + include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(mmap_hw_test) diff --git a/components/esp_netif/test_apps/test_app_esp_netif/CMakeLists.txt b/components/esp_netif/test_apps/test_app_esp_netif/CMakeLists.txt index ff3764931cc..c90b2d947cf 100644 --- a/components/esp_netif/test_apps/test_app_esp_netif/CMakeLists.txt +++ b/components/esp_netif/test_apps/test_app_esp_netif/CMakeLists.txt @@ -3,6 +3,9 @@ cmake_minimum_required(VERSION 3.16) set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components") +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) + include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(esp_netif_test) diff --git a/components/esp_netif/test_apps/test_app_vfs_l2tap/CMakeLists.txt b/components/esp_netif/test_apps/test_app_vfs_l2tap/CMakeLists.txt index 859cfa803c9..e046158b431 100644 --- a/components/esp_netif/test_apps/test_app_vfs_l2tap/CMakeLists.txt +++ b/components/esp_netif/test_apps/test_app_vfs_l2tap/CMakeLists.txt @@ -3,6 +3,9 @@ cmake_minimum_required(VERSION 3.16) set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components") +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) + include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(esp_vfs_l2tap_test) diff --git a/components/esp_psram/test_apps/psram/CMakeLists.txt b/components/esp_psram/test_apps/psram/CMakeLists.txt index 1cfb1964109..f358f3276df 100644 --- a/components/esp_psram/test_apps/psram/CMakeLists.txt +++ b/components/esp_psram/test_apps/psram/CMakeLists.txt @@ -2,4 +2,8 @@ cmake_minimum_required(VERSION 3.5) include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) + project(psram_test) diff --git a/components/esp_psram/test_apps/psram/main/CMakeLists.txt b/components/esp_psram/test_apps/psram/main/CMakeLists.txt index f00ce1a11c2..d19067a3854 100644 --- a/components/esp_psram/test_apps/psram/main/CMakeLists.txt +++ b/components/esp_psram/test_apps/psram/main/CMakeLists.txt @@ -10,4 +10,5 @@ endif() # In order for the cases defined by `TEST_CASE` to be linked into the final elf, # the component can be registered as WHOLE_ARCHIVE idf_component_register(SRCS ${srcs} + PRIV_REQUIRES unity esp_psram spi_flash driver esp_partition WHOLE_ARCHIVE) diff --git a/components/esp_wifi/test_apps/wifi_connect/CMakeLists.txt b/components/esp_wifi/test_apps/wifi_connect/CMakeLists.txt index cf8c41f302c..4d7035c22bc 100644 --- a/components/esp_wifi/test_apps/wifi_connect/CMakeLists.txt +++ b/components/esp_wifi/test_apps/wifi_connect/CMakeLists.txt @@ -3,6 +3,9 @@ cmake_minimum_required(VERSION 3.16) set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components") +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) + include($ENV{IDF_PATH}/tools/cmake/project.cmake) if($ENV{CI_PIPELINE_ID}) diff --git a/components/esp_wifi/test_apps/wifi_function/CMakeLists.txt b/components/esp_wifi/test_apps/wifi_function/CMakeLists.txt index 7f6e55fa727..1707a7102cc 100644 --- a/components/esp_wifi/test_apps/wifi_function/CMakeLists.txt +++ b/components/esp_wifi/test_apps/wifi_function/CMakeLists.txt @@ -3,5 +3,8 @@ cmake_minimum_required(VERSION 3.16) set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components") +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) + include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(wifi_test) diff --git a/components/freertos/test_apps/freertos/CMakeLists.txt b/components/freertos/test_apps/freertos/CMakeLists.txt index 3d41d57ac1e..02b26ae0acd 100644 --- a/components/freertos/test_apps/freertos/CMakeLists.txt +++ b/components/freertos/test_apps/freertos/CMakeLists.txt @@ -1,21 +1,21 @@ # This is the project CMakeLists.txt file for the test subproject cmake_minimum_required(VERSION 3.16) -# FreeRTOS tests of different types (e.g., kernel, port, performance etc.)are -# split into different directores in the test app's root directory. Each test -# type is treated as separate component -set(test_types - "kernel" - "misc" - "performance" - "port") - -list(APPEND EXTRA_COMPONENT_DIRS - ${test_types} # Add each test type as a component - "$ENV{IDF_PATH}/tools/unit-test-app/components") # For test_utils component - -#"Trim" the build. Include the minimal set of components, main, and anything it depends on. -set(COMPONENTS main esp_psram ${test_types}) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +# Set extra component directories for +# - test_utils component +# - the different test types (e.g., kernel, port, performance, ...) that are organized as components +set(EXTRA_COMPONENT_DIRS + "$ENV{IDF_PATH}/tools/unit-test-app/components" + "./kernel" + "./misc" + "./performance" + "./port" +) + +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. We also depend on esp_psram +# as we enable CONFIG_SPIRAM_... options. +set(COMPONENTS main esp_psram) + project(freertos_test) diff --git a/components/freertos/test_apps/freertos/main/CMakeLists.txt b/components/freertos/test_apps/freertos/main/CMakeLists.txt index 0d8828ca143..f73b1906dbb 100644 --- a/components/freertos/test_apps/freertos/main/CMakeLists.txt +++ b/components/freertos/test_apps/freertos/main/CMakeLists.txt @@ -1,2 +1,3 @@ idf_component_register(SRCS "test_freertos_main.c" - PRIV_REQUIRES unity test_utils driver) + # Pull in the components containing each type of FreeRTOS test + PRIV_REQUIRES unity test_utils kernel misc performance port) diff --git a/components/freertos/test_apps/freertos/misc/CMakeLists.txt b/components/freertos/test_apps/freertos/misc/CMakeLists.txt index cb1b5fdeb84..40bb3aa087e 100644 --- a/components/freertos/test_apps/freertos/misc/CMakeLists.txt +++ b/components/freertos/test_apps/freertos/misc/CMakeLists.txt @@ -3,5 +3,5 @@ # In order for the cases defined by `TEST_CASE` in "misc" to be linked into # the final elf, the component can be registered as WHOLE_ARCHIVE idf_component_register(SRC_DIRS "." - PRIV_REQUIRES test_utils + PRIV_REQUIRES unity test_utils WHOLE_ARCHIVE) diff --git a/components/freertos/test_apps/freertos/performance/CMakeLists.txt b/components/freertos/test_apps/freertos/performance/CMakeLists.txt index 2fc8feb7395..d7be03bc1b3 100644 --- a/components/freertos/test_apps/freertos/performance/CMakeLists.txt +++ b/components/freertos/test_apps/freertos/performance/CMakeLists.txt @@ -3,5 +3,5 @@ # In order for the cases defined by `TEST_CASE` in "performance" to be linked into # the final elf, the component can be registered as WHOLE_ARCHIVE idf_component_register(SRC_DIRS "." - PRIV_REQUIRES test_utils + PRIV_REQUIRES unity test_utils WHOLE_ARCHIVE) diff --git a/components/freertos/test_apps/freertos/port/CMakeLists.txt b/components/freertos/test_apps/freertos/port/CMakeLists.txt index 04522f2caf7..6eb7eb8d09b 100644 --- a/components/freertos/test_apps/freertos/port/CMakeLists.txt +++ b/components/freertos/test_apps/freertos/port/CMakeLists.txt @@ -3,5 +3,5 @@ # In order for the cases defined by `TEST_CASE` in "port" to be linked into # the final elf, the component can be registered as WHOLE_ARCHIVE idf_component_register(SRC_DIRS "." - PRIV_REQUIRES test_utils + PRIV_REQUIRES unity test_utils WHOLE_ARCHIVE) diff --git a/components/ieee802154/test_apps/test_ieee802154/CMakeLists.txt b/components/ieee802154/test_apps/test_ieee802154/CMakeLists.txt index 6f32785a15e..b7ca706cb4c 100644 --- a/components/ieee802154/test_apps/test_ieee802154/CMakeLists.txt +++ b/components/ieee802154/test_apps/test_ieee802154/CMakeLists.txt @@ -2,4 +2,8 @@ cmake_minimum_required(VERSION 3.16) include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) + project(test_ieee802154) diff --git a/components/ieee802154/test_apps/test_ieee802154/main/CMakeLists.txt b/components/ieee802154/test_apps/test_ieee802154/main/CMakeLists.txt index d0a58e94a05..625a6175c9e 100644 --- a/components/ieee802154/test_apps/test_ieee802154/main/CMakeLists.txt +++ b/components/ieee802154/test_apps/test_ieee802154/main/CMakeLists.txt @@ -8,4 +8,5 @@ set(include "." # the component can be registered as WHOLE_ARCHIVE idf_component_register(SRCS ${srcs} INCLUDE_DIRS include + PRIV_REQUIRES ieee802154 console fatfs nvs_flash esp_phy WHOLE_ARCHIVE) diff --git a/components/spi_flash/test_apps/esp_flash/CMakeLists.txt b/components/spi_flash/test_apps/esp_flash/CMakeLists.txt index b18abb0cd0a..91389d9e265 100644 --- a/components/spi_flash/test_apps/esp_flash/CMakeLists.txt +++ b/components/spi_flash/test_apps/esp_flash/CMakeLists.txt @@ -3,6 +3,10 @@ cmake_minimum_required(VERSION 3.16) set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components") +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. We also depend on +# esptool_py as we set CONFIG_ESPTOOLPY_... options. +set(COMPONENTS main esptool_py) + include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(test_esp_flash_drv) diff --git a/components/spi_flash/test_apps/esp_flash/main/CMakeLists.txt b/components/spi_flash/test_apps/esp_flash/main/CMakeLists.txt index f5377211c60..9e4bf2b0153 100644 --- a/components/spi_flash/test_apps/esp_flash/main/CMakeLists.txt +++ b/components/spi_flash/test_apps/esp_flash/main/CMakeLists.txt @@ -5,4 +5,5 @@ set(srcs "test_app_main.c" # In order for the cases defined by `TEST_CASE` to be linked into the final elf, # the component can be registered as WHOLE_ARCHIVE idf_component_register(SRCS ${srcs} + PRIV_REQUIRES unity test_utils spi_flash esp_timer driver bootloader_support WHOLE_ARCHIVE) diff --git a/components/spi_flash/test_apps/esp_flash_stress/CMakeLists.txt b/components/spi_flash/test_apps/esp_flash_stress/CMakeLists.txt index e5572915823..b650bb10c9c 100644 --- a/components/spi_flash/test_apps/esp_flash_stress/CMakeLists.txt +++ b/components/spi_flash/test_apps/esp_flash_stress/CMakeLists.txt @@ -3,6 +3,10 @@ cmake_minimum_required(VERSION 3.16) set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/components/spi_flash/test_apps/components") +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. We also depend on esp_psram +# and esptool_py as we set CONFIG_SPIRAM_... and CONFIG_ESPTOOLPY_... options. +set(COMPONENTS main esp_psram esptool_py) + include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(test_esp_flash_stress) diff --git a/components/spi_flash/test_apps/flash_encryption/CMakeLists.txt b/components/spi_flash/test_apps/flash_encryption/CMakeLists.txt index 6f1f0178937..941d38b996d 100644 --- a/components/spi_flash/test_apps/flash_encryption/CMakeLists.txt +++ b/components/spi_flash/test_apps/flash_encryption/CMakeLists.txt @@ -2,4 +2,9 @@ cmake_minimum_required(VERSION 3.16) include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. We also depend on esp_psram +# and esptool_py as we set CONFIG_SPIRAM_... and CONFIG_ESPTOOLPY_... options. +set(COMPONENTS main esp_psram esptool_py) + project(test_flash_encryption) diff --git a/components/spi_flash/test_apps/flash_encryption/main/CMakeLists.txt b/components/spi_flash/test_apps/flash_encryption/main/CMakeLists.txt index df989b72747..491d7e107de 100644 --- a/components/spi_flash/test_apps/flash_encryption/main/CMakeLists.txt +++ b/components/spi_flash/test_apps/flash_encryption/main/CMakeLists.txt @@ -2,5 +2,6 @@ set(srcs "test_app_main.c" "test_flash_encryption.c") idf_component_register(SRCS ${srcs} + PRIV_REQUIRES unity spi_flash bootloader_support esp_partition WHOLE_ARCHIVE) target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") diff --git a/components/spi_flash/test_apps/flash_mmap/CMakeLists.txt b/components/spi_flash/test_apps/flash_mmap/CMakeLists.txt index 0bd6bf58022..716f502a832 100644 --- a/components/spi_flash/test_apps/flash_mmap/CMakeLists.txt +++ b/components/spi_flash/test_apps/flash_mmap/CMakeLists.txt @@ -3,5 +3,9 @@ cmake_minimum_required(VERSION 3.16) set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components") +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. We also depend on esp_psram +# as we set CONFIG_SPIRAM_... options. +set(COMPONENTS main esp_psram) + include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(test_flash_mmap) diff --git a/components/spi_flash/test_apps/flash_mmap/main/CMakeLists.txt b/components/spi_flash/test_apps/flash_mmap/main/CMakeLists.txt index c75f516f7c4..903367c6e10 100644 --- a/components/spi_flash/test_apps/flash_mmap/main/CMakeLists.txt +++ b/components/spi_flash/test_apps/flash_mmap/main/CMakeLists.txt @@ -4,4 +4,5 @@ set(srcs "test_app_main.c" # In order for the cases defined by `TEST_CASE` to be linked into the final elf, # the component can be registered as WHOLE_ARCHIVE idf_component_register(SRCS ${srcs} + PRIV_REQUIRES unity test_utils spi_flash bootloader_support esp_partition WHOLE_ARCHIVE) diff --git a/components/spi_flash/test_apps/flash_suspend/CMakeLists.txt b/components/spi_flash/test_apps/flash_suspend/CMakeLists.txt index 46da0ba372b..03504ecd6a2 100644 --- a/components/spi_flash/test_apps/flash_suspend/CMakeLists.txt +++ b/components/spi_flash/test_apps/flash_suspend/CMakeLists.txt @@ -3,5 +3,8 @@ cmake_minimum_required(VERSION 3.16) set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components") +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) + include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(test_flash_suspend) diff --git a/components/spi_flash/test_apps/flash_suspend/main/CMakeLists.txt b/components/spi_flash/test_apps/flash_suspend/main/CMakeLists.txt index e017e8371ec..3423bf3e020 100644 --- a/components/spi_flash/test_apps/flash_suspend/main/CMakeLists.txt +++ b/components/spi_flash/test_apps/flash_suspend/main/CMakeLists.txt @@ -4,4 +4,5 @@ set(srcs "test_app_main.c" # In order for the cases defined by `TEST_CASE` to be linked into the final elf, # the component can be registered as WHOLE_ARCHIVE idf_component_register(SRCS ${srcs} + PRIV_REQUIRES unity test_utils spi_flash driver esp_partition WHOLE_ARCHIVE) diff --git a/components/spi_flash/test_apps/mspi_test/CMakeLists.txt b/components/spi_flash/test_apps/mspi_test/CMakeLists.txt index be1acb2a34d..4f170010954 100644 --- a/components/spi_flash/test_apps/mspi_test/CMakeLists.txt +++ b/components/spi_flash/test_apps/mspi_test/CMakeLists.txt @@ -1,6 +1,10 @@ # This is the project CMakeLists.txt file for the test subproject cmake_minimum_required(VERSION 3.16) +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. We also depend on esp_psram +# as we set CONFIG_SPIRAM_... options. +set(COMPONENTS main esp_psram) + include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(mspi_test) diff --git a/components/spi_flash/test_apps/mspi_test/main/CMakeLists.txt b/components/spi_flash/test_apps/mspi_test/main/CMakeLists.txt index cfbf0f1b399..4e1e8bed59c 100644 --- a/components/spi_flash/test_apps/mspi_test/main/CMakeLists.txt +++ b/components/spi_flash/test_apps/mspi_test/main/CMakeLists.txt @@ -5,4 +5,5 @@ set(srcs "test_cache_disabled.c" "test_app_main.c") idf_component_register(SRCS ${srcs} + PRIV_REQUIRES unity spi_flash driver esp_partition bootloader_support app_update WHOLE_ARCHIVE) diff --git a/components/ulp/test_apps/lp_core/CMakeLists.txt b/components/ulp/test_apps/lp_core/CMakeLists.txt index 2a29e3574d3..5a16c97e491 100644 --- a/components/ulp/test_apps/lp_core/CMakeLists.txt +++ b/components/ulp/test_apps/lp_core/CMakeLists.txt @@ -7,5 +7,8 @@ set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components" ) +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) + include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(lp_core_test) diff --git a/components/ulp/test_apps/ulp_riscv/CMakeLists.txt b/components/ulp/test_apps/ulp_riscv/CMakeLists.txt index eba0bce5584..a01a1701205 100644 --- a/components/ulp/test_apps/ulp_riscv/CMakeLists.txt +++ b/components/ulp/test_apps/ulp_riscv/CMakeLists.txt @@ -3,5 +3,8 @@ cmake_minimum_required(VERSION 3.16) list(PREPEND SDKCONFIG_DEFAULTS "$ENV{IDF_PATH}/tools/test_apps/configs/sdkconfig.debug_helpers" "sdkconfig.defaults") +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) + include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(ulp_riscv_test) diff --git a/components/usb/test_apps/hcd/CMakeLists.txt b/components/usb/test_apps/hcd/CMakeLists.txt index e0c09e31132..3294266f463 100644 --- a/components/usb/test_apps/hcd/CMakeLists.txt +++ b/components/usb/test_apps/hcd/CMakeLists.txt @@ -2,5 +2,10 @@ cmake_minimum_required(VERSION 3.16) include($ENV{IDF_PATH}/tools/cmake/project.cmake) + set(EXTRA_COMPONENT_DIRS "../common") + +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) + project(test_app_usb_host) diff --git a/components/usb/test_apps/usb_host/CMakeLists.txt b/components/usb/test_apps/usb_host/CMakeLists.txt index e0c09e31132..3294266f463 100644 --- a/components/usb/test_apps/usb_host/CMakeLists.txt +++ b/components/usb/test_apps/usb_host/CMakeLists.txt @@ -2,5 +2,10 @@ cmake_minimum_required(VERSION 3.16) include($ENV{IDF_PATH}/tools/cmake/project.cmake) + set(EXTRA_COMPONENT_DIRS "../common") + +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) + project(test_app_usb_host)