From 1f7c6667015ef3cb7a7e7b79f30c8735f7bf6353 Mon Sep 17 00:00:00 2001 From: Marius Vikhammer Date: Sun, 18 Feb 2024 13:52:59 +0800 Subject: [PATCH] ci(test_apps): limit dependencies for misc test_apps Only pull in direct dependencies for the test apps, reducing build time as well making it possible for CI to determine if the test should run or not when dependencies are changed. --- components/app_update/test_apps/CMakeLists.txt | 1 + components/esp-tls/test_apps/CMakeLists.txt | 1 + components/esp_http_client/test_apps/CMakeLists.txt | 1 + components/esp_http_server/test_apps/CMakeLists.txt | 1 + components/hal/test_apps/hal_i2c/CMakeLists.txt | 2 ++ components/hal/test_apps/hal_i2c/main/CMakeLists.txt | 3 ++- components/lwip/test_apps/CMakeLists.txt | 1 + components/protocomm/test_apps/CMakeLists.txt | 1 + components/tcp_transport/test_apps/CMakeLists.txt | 1 + components/tcp_transport/test_apps/main/CMakeLists.txt | 2 +- components/tcp_transport/test_apps/sdkconfig.ci.psram_esp32 | 2 -- components/touch_element/test_apps/CMakeLists.txt | 2 ++ components/touch_element/test_apps/main/CMakeLists.txt | 1 + 13 files changed, 15 insertions(+), 4 deletions(-) diff --git a/components/app_update/test_apps/CMakeLists.txt b/components/app_update/test_apps/CMakeLists.txt index 3253e2231aa..35fff8ca41b 100644 --- a/components/app_update/test_apps/CMakeLists.txt +++ b/components/app_update/test_apps/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.16) set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components") +set(COMPONENTS main) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(app_update_test) diff --git a/components/esp-tls/test_apps/CMakeLists.txt b/components/esp-tls/test_apps/CMakeLists.txt index 086455137b9..a7ae249d6eb 100644 --- a/components/esp-tls/test_apps/CMakeLists.txt +++ b/components/esp-tls/test_apps/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.16) set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components") +set(COMPONENTS main) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(esp-tls_test) diff --git a/components/esp_http_client/test_apps/CMakeLists.txt b/components/esp_http_client/test_apps/CMakeLists.txt index e26a96a7914..c1475171d72 100644 --- a/components/esp_http_client/test_apps/CMakeLists.txt +++ b/components/esp_http_client/test_apps/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.16) set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components") +set(COMPONENTS main) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(esp_http_client_test) diff --git a/components/esp_http_server/test_apps/CMakeLists.txt b/components/esp_http_server/test_apps/CMakeLists.txt index 3d62a12c412..ac7ac108f59 100644 --- a/components/esp_http_server/test_apps/CMakeLists.txt +++ b/components/esp_http_server/test_apps/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.16) set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components") +set(COMPONENTS main) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(esp_http_server_test) diff --git a/components/hal/test_apps/hal_i2c/CMakeLists.txt b/components/hal/test_apps/hal_i2c/CMakeLists.txt index d40fddfb9b5..c646fa91195 100644 --- a/components/hal/test_apps/hal_i2c/CMakeLists.txt +++ b/components/hal/test_apps/hal_i2c/CMakeLists.txt @@ -2,5 +2,7 @@ # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.16) +set(COMPONENTS main) + include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(hal_i2c) diff --git a/components/hal/test_apps/hal_i2c/main/CMakeLists.txt b/components/hal/test_apps/hal_i2c/main/CMakeLists.txt index e99392033c3..75d55d2e849 100644 --- a/components/hal/test_apps/hal_i2c/main/CMakeLists.txt +++ b/components/hal/test_apps/hal_i2c/main/CMakeLists.txt @@ -1,4 +1,5 @@ set(srcs "hal_i2c_main.c") idf_component_register(SRCS ${srcs} - INCLUDE_DIRS ".") + INCLUDE_DIRS "." + PRIV_REQUIRES hal_i2c) diff --git a/components/lwip/test_apps/CMakeLists.txt b/components/lwip/test_apps/CMakeLists.txt index 69a0d3445ba..a6cce379ebc 100644 --- a/components/lwip/test_apps/CMakeLists.txt +++ b/components/lwip/test_apps/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.16) set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components") +set(COMPONENTS main) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(lwip_test) diff --git a/components/protocomm/test_apps/CMakeLists.txt b/components/protocomm/test_apps/CMakeLists.txt index a5df5df3af6..b0356c1b2d8 100644 --- a/components/protocomm/test_apps/CMakeLists.txt +++ b/components/protocomm/test_apps/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.16) set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components") +set(COMPONENTS main) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(protocomm_test) diff --git a/components/tcp_transport/test_apps/CMakeLists.txt b/components/tcp_transport/test_apps/CMakeLists.txt index 7e4a88e3d02..cad519eb86c 100644 --- a/components/tcp_transport/test_apps/CMakeLists.txt +++ b/components/tcp_transport/test_apps/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.16) set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components") +set(COMPONENTS main) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(esp_tcp_transport_test) diff --git a/components/tcp_transport/test_apps/main/CMakeLists.txt b/components/tcp_transport/test_apps/main/CMakeLists.txt index bc36d6b03d1..9c9c85da0ea 100644 --- a/components/tcp_transport/test_apps/main/CMakeLists.txt +++ b/components/tcp_transport/test_apps/main/CMakeLists.txt @@ -1,5 +1,5 @@ set(srcs "test_app_main.c" "test_transport_basic.c" "test_transport_connect" "test_transport_fixtures.c") idf_component_register(SRCS ${srcs} PRIV_INCLUDE_DIRS "../../private_include" "." - PRIV_REQUIRES cmock test_utils tcp_transport unity + PRIV_REQUIRES cmock test_utils tcp_transport unity esp_psram WHOLE_ARCHIVE) diff --git a/components/tcp_transport/test_apps/sdkconfig.ci.psram_esp32 b/components/tcp_transport/test_apps/sdkconfig.ci.psram_esp32 index 366c10c2cec..6a20d2b5317 100644 --- a/components/tcp_transport/test_apps/sdkconfig.ci.psram_esp32 +++ b/components/tcp_transport/test_apps/sdkconfig.ci.psram_esp32 @@ -3,8 +3,6 @@ CONFIG_UNITY_ENABLE_FIXTURE=y CONFIG_SPIRAM=y CONFIG_ESP_INT_WDT_TIMEOUT_MS=800 CONFIG_SPIRAM_OCCUPY_NO_HOST=y -CONFIG_ESP_WIFI_RX_IRAM_OPT=n -CONFIG_ESP_WIFI_IRAM_OPT=n # Disable encrypted flash reads/writes to save IRAM in this build configuration CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=n CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY=y diff --git a/components/touch_element/test_apps/CMakeLists.txt b/components/touch_element/test_apps/CMakeLists.txt index d31bc595654..f68329df026 100644 --- a/components/touch_element/test_apps/CMakeLists.txt +++ b/components/touch_element/test_apps/CMakeLists.txt @@ -1,5 +1,7 @@ # This is the project CMakeLists.txt file for the test subproject cmake_minimum_required(VERSION 3.16) +set(COMPONENTS main) + include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(touch_element_test) diff --git a/components/touch_element/test_apps/main/CMakeLists.txt b/components/touch_element/test_apps/main/CMakeLists.txt index ebf7e88d23d..813e3e60b40 100644 --- a/components/touch_element/test_apps/main/CMakeLists.txt +++ b/components/touch_element/test_apps/main/CMakeLists.txt @@ -1,4 +1,5 @@ idf_component_register(SRCS "test_app_main.c" "test_touch_element.c" "test_touch_button.c" "test_touch_slider.c" "test_touch_matrix.c" + PRIV_REQUIRES unity touch_element WHOLE_ARCHIVE )