Commit Graph

12 Commits

Author SHA1 Message Date
Frantisek Hrbata
927fc8d03a test(cmakev2): add test for build with IDF_COMPONENT_MANAGER=0
Verify that setting IDF_COMPONENT_MANAGER=0 skips the component manager
flow entirely and produces a successful build. The test also asserts that
no "Component manager round" messages appear in the output, confirming
the manager loop is not entered.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-03-23 16:02:36 +01:00
Sudeep Mohanty
aa67c578fb test(cmakev2): Add pytest test for multi-binary build support
Made-with: Cursor
2026-03-18 09:27:51 +01:00
Sudeep Mohanty
a1306a094c test(cmakev2): Add pytest tests for v1-to-v2 migration and utility APIs
Made-with: Cursor
2026-03-18 09:27:51 +01:00
Sudeep Mohanty
d6b1fd56a4 test(cmakev2): Assert ELF output in Linux target build test
Made-with: Cursor
2026-03-18 09:27:51 +01:00
Sudeep Mohanty
f00d5db927 test(cmakev2): Expand pytest tests for v2 Kconfig and sdkconfig behavior
Made-with: Cursor
2026-03-18 09:27:51 +01:00
Sudeep Mohanty
3f477b9d80 test(cmakev2): Add pytest tests for v2 component model
Made-with: Cursor
2026-03-18 09:27:51 +01:00
Sudeep Mohanty
c2cba58409 test(cmakev2): Add pytest tests for build APIs
Made-with: Cursor
2026-03-18 09:25:12 +01:00
Sudeep Mohanty
e53d8e9a74 test(cmakev2): Add pytest tests for project APIs 2026-03-16 10:57:26 +01:00
Sudeep Mohanty
19040b761b test(cmakev2): add POST_ELF build event callback test 2026-02-24 15:17:08 +01:00
Frantisek Hrbata
7bc635bd9e fix(test_build_system): add __init__.py to buildv2 test directory
Pytest's default import mode (prepend/rootdir) imports test modules as
top-level modules keyed by filename. When two directories contain test
files with the same basename (e.g. test_sdkconfig.py in both
test_build_system/ and test_build_system/buildv2/), pytest tries to
register both as the module name "test_sdkconfig". The second collection
fails with "import file mismatch" because the module object already
cached in sys.modules points to the first file.

Adding __init__.py to the buildv2/ directory makes it a proper Python
package. Pytest then imports its test modules under the package
namespace (buildv2.test_sdkconfig), which is distinct from the
top-level test_sdkconfig, resolving the collision.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-02-18 17:29:18 +08:00
Frantisek Hrbata
0f349ee404 fix(cmakev2/kconfig): preserve sdkconfig options from managed components
The sdkconfig file may contain configuration options defined in Kconfig
files of managed components. Since kconfgen runs before the component
manager fetches these components, the Kconfig definitions for managed
component options are not yet available. The kconfgen --output config
flag regenerates sdkconfig from kconfiglib's internal state, which only
knows about options with loaded Kconfig definitions. This causes unknown
options (i.e., those from managed components) to be silently dropped
from sdkconfig during intermediate regeneration rounds.

Note that kconfgen's --config flag (used for reading sdkconfig) only
performs deprecated option name replacement and does NOT drop unknown
options. The problem is exclusively in --output config, which writes a
fresh sdkconfig from the parsed Kconfig tree state.

Fix this by introducing a __SDKCONFIG_ORIG build property that provides
an indirection layer for the --config input path:

- Before the component manager runs: __SDKCONFIG_ORIG points to a copy
  of the original sdkconfig (build/sdkconfig.orig), created by the new
  __create_sdkconfig_orig_copy() function. This copy preserves all
  original options, including those from managed components.

- During intermediate kconfgen runs: --config reads from the preserved
  copy (so unknown options survive as input), while --output config
  writes to the real sdkconfig (unknown options may be dropped there,
  but this is harmless since kconfgen always reads from the copy).

- After the component manager completes: __SDKCONFIG_ORIG is reset to
  point to the real sdkconfig and __BASE_KCONFGEN_CMD is rebuilt, so
  that subsequent operations (menuconfig, save-defconfig, confserver)
  read and write the actual sdkconfig file directly.

The flow is:

  __create_sdkconfig_orig_copy()
    -> __SDKCONFIG_ORIG = build/sdkconfig.orig

  __generate_sdkconfig()
    -> --config build/sdkconfig.orig --output config project/sdkconfig

  __fetch_components_from_registry():
    loop:
      download_components()
      __generate_sdkconfig()
        -> --config build/sdkconfig.orig --output config project/sdkconfig
      if success: break
    endloop
    -> __SDKCONFIG_ORIG = project/sdkconfig
    -> rebuild __BASE_KCONFGEN_CMD

  idf_create_menuconfig() / save-defconfig / confserver
    -> uses --config project/sdkconfig (the real file)

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-02-18 17:29:18 +08:00
Frantisek Hrbata
cc294eee2b feat(test_build_system): add buildv2 test for linux target build
Add a simple test to verify that the buildv2_test_app can be built for
the Linux target.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-01-22 18:00:37 +01:00