fix(build): include test components in the minimal build

When minimal build is enabled, it only includes the main component and
its dependencies. This leads to test components specified through
TEST_COMPONENTS being ignored, meaning no tests are executed. The issue
arises because test components are also checked against the COMPONENTS
variable, and if they aren't listed there, they are disregarded.  To fix
this, explicitly add TEST_COMPONENTS to COMPONENTS when the minimal
build is enabled.

Closes https://github.com/espressif/esp-idf/issues/15485

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
This commit is contained in:
Frantisek Hrbata 2025-02-28 12:30:57 +01:00
parent 648dc329f6
commit 9eb6f68454

View File

@ -504,7 +504,7 @@ function(__project_init components_var test_components_var)
message(WARNING "The MINIMAL_BUILD property is disregarded because the COMPONENTS variable is defined.")
set(minimal_build OFF)
else()
set(COMPONENTS main)
set(COMPONENTS main ${TEST_COMPONENTS})
set(minimal_build ON)
endif()
else()