Commit Graph

120 Commits

Author SHA1 Message Date
Sudeep Mohanty 6a4d6eb6ac test(cmakev2): Enabled component validation tests for cmakev2 2025-12-18 13:54:18 +01:00
Sudeep Mohanty cad80548b1 test(cmakev2): Enable test_build_uf2 for buildv2 CI tests 2025-11-18 15:08:56 +05:30
Sudeep Mohanty a609d5bcd2 test(cmakev2): Enable test_build_dfu for buildv2 CI tests 2025-11-18 15:08:20 +05:30
Sudeep Mohanty f72292b0d7 test(cmakev2): Enable test_rebuild.py for buildv2 CI tests
The test_rebuild_no_changes test verifies that running idf.py build
successively without any file changes results in identical build
artifacts on the second run (i.e., nothing gets rebuilt).

This test was failing in buildv2 because it expected kconfig_menus.json
to be present in build/config/ after a normal build. However, in
cmakev2, kconfig_menus.json is not generated during regular builds.

In cmakev1, kconfig_menus.json was generated globally during every
build alongside other config files (sdkconfig.h, sdkconfig.cmake, etc).

In cmakev2, kconfig_menus.json generation does not happend for
normal builds because it depends on the Kconfig menu hierarchy
and cannot be generated globally. It must be generated per-executable.

Hence, this commit updates the artefacts list for cmakev2 to not expect
the kconfig_menus.json file during a build/re-build action.
2025-11-18 10:12:12 +05:30
Alexey Lapshin 583a9075fa fix(test): fix tests according to the new toolchain flags 2025-11-14 21:04:58 +07:00
Roland Dobai a0b589c147 Merge branch 'feat/cmakev2' into 'master'
feat(cmakev2): introduce cmake-based build system v2

See merge request espressif/esp-idf!42691
2025-11-04 02:53:36 +01:00
Sudeep Mohanty 496ebf0583 feat(cmakev2): Enabled test_cmake.py for cmakev2 in CI 2025-10-30 17:17:49 +08:00
Sudeep Mohanty f3ffef0075 feat(cmakev2): ruff formatting changes for test_cmake.py 2025-10-30 17:17:49 +08:00
Sudeep Mohanty 22eb926468 feat(cmakev2): Enabled all component manager tests for cmakev2 2025-10-30 17:17:49 +08:00
Frantisek Hrbata 1139551fde fix(test_build_system): disable tests related to outside component dependencies
The commit adb2d5deee ("feat(cmake): Produce warnings when component dependen..")
introduced additional checks for source files and include directories
used by a component that are located outside the component's directory.
If these files and directories belong to another component, a warning is
issued. This feature has not yet been implemented in cmakev2, so related
tests are temporary disabled.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Sudeep Mohanty 84e65e5d24 feat(cmakev2): Enable test_components.py for cmakev2 in CI 2025-10-30 17:17:49 +08:00
Sudeep Mohanty bb3ce41141 feat(cmakev2): ruff formatting changes for test_components.py 2025-10-30 17:17:49 +08:00
Sudeep Mohanty 0666fb28ea feat(cmakev2): Enabled test_common.py for cmakev2 2025-10-30 17:17:49 +08:00
Sudeep Mohanty 7fe743896d feat(cmakev2): Rename buildv2_test_app source file
This commit renames the buildv2_test_app.c file to build_test_app.c in
the buildv2_test_app template to enable tests to refer to the same
source file name when writing tests for both cmakev1 and cmakev2.
2025-10-30 17:17:49 +08:00
Sudeep Mohanty c63063f3f6 feat(cmakev2): Enabled test_versions.py for cmakev2 2025-10-30 17:17:49 +08:00
Sudeep Mohanty f51b79dbe0 feat(cmakev2): ruff formatting changes for test_versions.py 2025-10-30 17:17:49 +08:00
Frantisek Hrbata 75cf711cc3 fix(test_build_system): use block comment instead of return for cmakev2 test app
Commit 46b41dfec187 ("test(cmakev2): Enable CI tests for component manager ..")
introduced a temporary workaround for the cmakev2 testing
application by including the cmakev1 project.cmake file after the
return() statement. The issue is that some tests, such as
test_build_fail_on_build_time, append commands to the project's
CMakeLists.txt. These commands are placed after the newly added return()
statement, causing them to be ignored and resulting in test failures. To
resolve this, include the cmakev1 project.cmake within the cmake block
comment.

Fixes: 46b41dfec187 ("test(cmakev2): Enable CI tests for component manager ..")
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata 99002a86af feat(test_build_system): enable test_build.py to be executed using cmakev2
Three tests are disabled for cmakev2:
* test_build_dfu
* test_build_uf2
* test_build_loadable_elf

and one is modified:
* test_build_skdconfig_phy_init_data

the other 14 tests should pass.

The tests, test_build_dfu and test_build_uf2, are temporarily disabled
because cmakev2 currently does not include the dfu and uf2 targets.
These tests should be re-enabled once support is added to cmakev2.

The test_build_loadable_elf is disabled because the bootloader_support
component determines its requirements based on the sdkconfig values,
specifically the CONFIG_APP_BUILD_TYPE_RAM used in this test. When
CONFIG_APP_BUILD_TYPE_RAM is set, bootloader_support declares a
dependency on micro-ecc. This is wrong even in cmakev1 and should be
fixed.

The test_build_skdconfig_phy_init_data test requires the esp_phy
component but does not specify it in its requirements. It relies on the
cmakev1 behavior, where all components are included in the build by
default. This approach does not work for cmakev2. To resolve this, make
the dependency on esp_phy explicit, ensuring compatibility with both
versions.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata f28ebc5175 fix(test_build_system): rename Kconfig.projbuild to KConfig.projbuild
The test_build_with_misspelled_kconfig test expects a KConfig.projbuild
file in the main component. However, the file is correctly named
Kconfig.projbuild, which causes the test to fail for cmakev2.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Sudeep Mohanty 0c69d53b68 test(cmakev2): Enable CI tests for component manager for cmakev2
This commit adapts the component manager build tests for cmakev2 and
enables them for CI test runs.
2025-10-30 17:17:49 +08:00
Frantisek Hrbata e45b86ac9d fix(test_build_system): use idf_project_default in buildv2 test app
Since the idf_project_default is already available, let's use it in the
buildv2 testing application. Also change the test app name from
buildv2_test_app to build_test_app, as some tests require the ELF and
bin images to be created under this name.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata f2a7c311fd feat(test_build_system): add buildv2_skip marker
This marker enables the skipping of tests that, for any reason, cannot
be executed with the IDF build system version 2. It accepts an optional
string argument that explains why the test cannot be run with version 2.
If no explanation is provided, a default message is used. This marker is
used in the `pytest_collection_modifyitems` hook to skip tests marked
with it when the `--buildv2` pytest command line option is used.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata 05ec102b9f fix(test_build_system): fix ruff formatting for conftest.py
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata 1da7f3714f feat(test_build_system): add --buildv2 pytest option and buildv2 test app
The IDF build system v2 should be backward compatible with IDF build
system v1 in most situations. Therefore, it makes sense to reuse the
existing v1 tests and run them for v2 as well. This approach will help
ensure that v2 maintains backward compatibility. Introduce a new
--buildv2 option, which switches the existing tests to use the newly
added buildv2_test_app for v2. The goal is to enable the existing v1
tests incrementally in CI as the v2 implementation progresses.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata d5befe0742 fix(test_build_system): fix ruff formatting for test_non_default_target.py
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata 5bdcfc4a5b fix(test_build_system): pop SDKCONFIG_DEFAULTS from the environment
The test for guessing the target from the SDKCONFIG_DEFAULTS environment
variable is not cleaning up after itself, leaving the SDKCONFIG_DEFAULTS
environment variable set. The subsequent test performs target guessing
from SDKCONFIG_DEFAULTS passed to cmake with the -D option. The
SDKCONFIG_DEFAULTS environment variable should take precedence over the
SDKCONFIG_DEFAULTS cmake variable. This is correctly handled in cmakev2
, but in cmakev1, the SDKCONFIG_DEFAULTS cmake variable is used even if
the SDKCONFIG_DEFAULTS environment variable is set. This appears to be a
bug or at least an inconsistency in cmakev1.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Marek Fiala 1e351a8b67 test(tools): Moved preset parsing into core_ext.py and added tests 2025-10-29 11:47:40 +08:00
Peter Dragun e3198fff3c feat: Update esptool to v5 2025-09-30 15:28:55 +02:00
Roland Dobai adb2d5deee feat(cmake): Produce warnings when component dependencies are not defined
There are idf.py hints for helping the user to set component
dependencies properly instead of building sources out-of-component or
including headers from outside the component directory. These are
produced with
tools/idf_py_actions/hint_modules/component_requirements.py.

However, idf.py hints are printed only when the build fails. If the user
starts with a buildable solution then the suggestions to add component
dependencies are not printed.

This commit introduces cmake-level warnings for building source files
from outside the component and including header files without setting up
proper component dependencies.
2025-09-24 13:43:23 +02:00
Roland Dobai c3729929a8 change(tools): Fix pre-commit checks for test_components.py 2025-09-24 13:43:23 +02:00
Marek Fiala 96ff174dac feat(tools): idf.py extension - added interface version 2025-09-23 15:26:33 +08:00
Marek Fiala 74f75feb3a test(tools): Added idf extensions build system tests 2025-09-23 15:26:33 +08:00
Alexey Lapshin 2d12315b62 fix(tools): clean gdbinit files generation 2025-09-17 16:58:02 +08:00
Alexey Lapshin 612b5f88db fix(tools): apply pre-commit hook changes 2025-09-17 16:58:02 +08:00
Alexey Lapshin 9281e78381 change(esp_libc): rename newlib component to esp_libc 2025-09-09 22:00:44 +08:00
Alexey Lapshin 1275129a62 Merge branch 'fix/actulize_newlib_kconfig_variables' into 'master'
fix(config): actualize newlib Kcongig options

See merge request espressif/esp-idf!41301
2025-08-29 11:37:44 +04:00
Jakub Kocka 117919d7d6 Merge branch 'fix/click_version' into 'master'
Fixed click deprecation warnings

Closes IDF-13075 and IDF-13088

See merge request espressif/esp-idf!40765
2025-08-29 14:48:55 +08:00
Sudeep Mohanty 5eb8e746fc Merge branch 'fix/build_system_create_bin_gen_tgts' into 'master'
feat(build-system): Create build system hooks for post-elf processing

Closes IDFGH-16204

See merge request espressif/esp-idf!41097
2025-08-28 14:35:21 +02:00
Alexey Lapshin 28ced4efad fix(config): actualize newlib Kconfig options 2025-08-28 12:25:09 +08:00
Jakub Kocka 2affbb9509 refactor(tools): Updated tests to corespond with massage changes 2025-08-26 13:50:45 +02:00
Fu Hanxi 60e9ec429d fix: kconfig optional dependency in transitive dependency 2025-08-25 14:32:05 +02:00
Peter Dragun eba6b814ba feat: Add support for esptool v5 and keep v4 for now 2025-08-21 15:53:39 +02:00
Marek Fiala 9d35d63651 feat(cmake): Update minimum cmake version to 3.22 (whole repository) 2025-08-19 14:44:32 +02:00
Sudeep Mohanty 4cfc196680 feat(build-system): Create build system hooks for post-ELF processing
This commit adds new CMake APIs for the build system, viz.,
idf_build_add_post_elf_dependency() and
idf_build_get_post_elf_dependencies().
These APIs allow components to add post-ELF processing hooks before the
binary file is generated.

Closes https://github.com/espressif/esp-idf/issues/17251
2025-08-15 12:22:47 +02:00
Fu Hanxi 0d5b3e60ac ci: remove --enable-pytest from install.sh 2025-07-09 10:33:26 +02:00
Fu Hanxi fc4b2fbc28 Merge branch 'ci/disable-plugin-idf_ci' into 'master'
ci: disable idf-ci plugin

See merge request espressif/esp-idf!39600
2025-06-04 12:12:18 +02:00
Fu Hanxi 9f4b9d815a feat: support kconfig in component manager 2025-06-03 08:43:09 +02:00
Fu Hanxi 87a5aedb85 ci: disable idf-ci plugin
this plugin will be re-enabled with compatible code in !38755
2025-06-03 08:37:56 +02:00
Jan Beran c6a0d9118e change: Support misspelled Kconfig[.projbuild] file names
If the name is misspelled, CMake prints out a warning.
Original issue: https://github.com/espressif/esp-idf-kconfig/issues/14
2025-05-29 14:18:20 +02:00
Marek Fiala 1507ec7466 fix(test): Proper cleanup after build_custom_cmake pytest
The test create build folder in current directory which
in this case is defined by (test_app_copy).
It also creates sdkconfig file in cmake source directory, which
is defined as $IDF_PATH/examples/build_system/cmake/idf_as_lib

The fixtures ensures proper cleanup even when test fails.
2025-04-15 15:09:27 +02:00