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 1864548037..7f6a4ab7bc 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 23741b95bc..008413a567 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 b308cb2ddd..e69de29bb2 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 e87048a211..42e63786a1 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 0fb8a69f50..4088442971 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 d5c75a52b3..0d009db679 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 e824508d65..14c910836c 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 ecada2191f..af6aff96e7 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 8d30280ddb..f2dc595cbc 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 493e4aa2ed..75826523ec 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 a26b8b7aee..1136a2b237 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 9c62f764dc..8c099ff31c 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 b969d9dbf9..a168fe90a0 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 e349686fc1..3e976ca666 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 d1e1dbc25f..fac8366284 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 ff3764931c..c90b2d947c 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 859cfa803c..e046158b43 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 1cfb196410..f358f3276d 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 f00ce1a11c..d19067a385 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 cf8c41f302..4d7035c22b 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 7f6e55fa72..1707a7102c 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 3d41d57ac1..02b26ae0ac 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 0d8828ca14..f73b1906db 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 cb1b5fdeb8..40bb3aa087 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 2fc8feb739..d7be03bc1b 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 04522f2caf..6eb7eb8d09 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 6f32785a15..b7ca706cb4 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 d0a58e94a0..625a6175c9 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 b18abb0cd0..91389d9e26 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 f5377211c6..9e4bf2b015 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 e557291582..b650bb10c9 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 6f1f017893..941d38b996 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 df989b7274..491d7e107d 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 0bd6bf5802..716f502a83 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 c75f516f7c..903367c6e1 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 46da0ba372..03504ecd6a 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 e017e8371e..3423bf3e02 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 be1acb2a34..4f17001095 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 cfbf0f1b39..4e1e8bed59 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 2a29e3574d..5a16c97e49 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 eba0bce558..a01a170120 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 e0c09e3113..3294266f46 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 e0c09e3113..3294266f46 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)