Commit Graph

32 Commits

Author SHA1 Message Date
Marek Fiala
8c08c75f48 feat(tools): adopt esp-pylib for idf.py logging and errors
Migrate idf.py and its actions to the shared esp-pylib library:
- add esp-pylib (and esp-pylib[ide]) to the core/ide requirements
- base FatalError on esp_pylib.errors.FatalError, keeping the idf.py ctx cleanup
- replace the local raw-ANSI helpers (red_print/yellow_print/print_warning/
  color_print) with esp_pylib.logger.log (warn/err/note/hint) across the
  idf.py actions
- install esp_pylib exception reporting at the idf.py entry point and silence
  the logger during shell completion
- update affected tests for the new prefixes/line wrapping
- add normalize_output() helper and unify terminal env in conftest to handle
  Rich line-wrapping in CI assertions

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 20:19:07 +08:00
Marek Fiala
f8799b8bba feat(tools): idf.py --help custom CMake targets rich-click style 2026-06-01 20:07:27 +08:00
Frantisek Hrbata
11f73606cb test(cmakev2): skip idf.py --help CMake custom targets tests under buildv2
Two tests added in commit c21d05e612 (MR !46354 "Added cmake target
listing in help") fail under pytest_buildv2_system /
pytest_buildv2_system_win:

  * test_idf_py_help_after_configure_with_no_custom_targets_has_no_section
  * test_idf_py_help_lists_cmake_custom_targets_after_configure

The tests assert that internal phony build targets do not appear
under "CMake Custom Targets" in idf.py --help. Filtering is driven
by tools/idf_py_actions/help_custom_targets_skip.py, whose exact-name
allowlist and shape policy were calibrated against cmakev1 target
names. cmakev1 either hard-codes the names ("app_check_size") or
uses a prefix already covered by HELP_PHONY_NAME_PREFIXES
("gen_<project>_binary"), so v1 stays out of the section.

cmakev2 parameterizes the same logical targets by the project name
in tools/cmakev2/build.cmake and tools/cmakev2/project.cmake and
produces, for project "build_test_app":

  build_test_app_binary
  build_test_app_binary_check_size
  build_test_app_mapfile
  build_test_app.map
  ldgen_libraries.in_library_build_test_app

None of these match the v1-shaped allowlist or shape policy, so
both tests fail on every cmakev2 project rather than only on this
test app. Skip them under buildv2 with @pytest.mark.buildv2_skip
to unblock CI while a more robust filtering strategy is worked out.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-04-30 17:47:42 +02:00
Jakub Kocka
d715ed0244 Merge branch 'feat/create-project_c++' into 'master'
feat(tools): Added create-project argument to allow cpp project creation

Closes IDFGH-15480

See merge request espressif/esp-idf!47373
2026-04-28 17:37:03 +08:00
Jakub Kocka
c21d05e612 feat(tools): Added listing of CMake custom targets in idf.py --help 2026-04-28 09:46:35 +02:00
Jakub Kocka
fb02854ad6 feat(tools): Added create-project argument to allow cpp project creation
Closes https://github.com/espressif/esp-idf/issues/16121
2026-04-28 09:24:20 +02:00
Roland Dobai
f46452d3ab feat(cmake): Create a merged hints database in the build directory 2026-03-23 09:24:45 +01:00
Roland Dobai
5410fc0d5c Merge branch 'feat/esp_idf_sbom' into 'master'
feat(tools): esp-idf-sbom integration into idf.py

Closes IDF-15120

See merge request espressif/esp-idf!45696
2026-02-20 10:18:47 +01:00
Sudeep Mohanty
f3456ea214 fix(cmakev2): Fixed test_hint_components_loading for buildv2
The test_hint_components_loading fails for buildv2 because the build
system only links the main component but not the components with the
hints.yml. Updated the test to explicitly include the new components in
the build.
2026-02-17 16:51:07 +01:00
Frantisek Hrbata
b90098a9f2 feat(tools): esp-idf-sbom integration into idf.py
While the `esp-idf-sbom` `idf.py` extension is implemented within the
`esp-idf-sbom` python package, a few minor changes are also required on
the `idf.py` side.

1. Add `esp-idf-sbom` as a core requirement so it is automatically
   installed by the installation scripts.
2. Add the `sbom-create` action to the list of actions for which the
   flashing-related closing message is displayed.
3. Update the documentation in the api-guides for tools.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-02-16 09:03:17 +01:00
Marek Fiala
c311fb0db3 test(tools): Added test for coponent hints loading 2026-02-13 15:59:31 +08:00
Sudeep Mohanty
0666fb28ea feat(cmakev2): Enabled test_common.py for cmakev2 2025-10-30 17:17:49 +08:00
Jakub Kocka
2affbb9509 refactor(tools): Updated tests to corespond with massage changes 2025-08-26 13:50:45 +02:00
Jan Beran
950428c2f4 feat(tools): Add often used espefuse subcommands to idf.py 2024-06-07 16:23:17 +02:00
Marek Fiala
e351a4407a fix(tools): fix failing create readonly project build system test
Changed the way of removing copied esp-idf folder.
2024-04-30 16:42:05 +02:00
Roland Dobai
af302c0bee Merge branch 'feat/add_merged_bin_cmd' into 'master'
feat(tools): Add idf.py merge-bin command and cmake target

See merge request espressif/esp-idf!29996
2024-04-22 17:55:36 +08:00
Fu Hanxi
2cde75b531 ci: improve pytest build system tests
- remove temp dirs
- remove idf-component-manager unit test
2024-04-16 15:33:43 +02:00
Jan Beran
0dec6fe65d feat(tools): Add idf.py merge-bin command and cmake target 2024-04-16 12:49:18 +02:00
Marek Fiala
52da5b765f feat(tools): Run skipped build system pytests on Win 2024-02-08 11:23:51 +01:00
Marek Fiala
04ade501aa feat(tools): Disable failing build system tests on Windows runner 2023-11-29 23:10:38 +01:00
Marek Fiala
b39e541652 feat(tools): Do not run test_create_project_with_idf_readonly on macOS
It corrupts environment on macOS runner because it uses shell, not docker-executor,
and makes all tree read-only for a non-root user.

+ Replace examples with real files in example README.md
2023-08-31 12:54:19 +02:00
Roland Dobai
79b15bd410 Merge branch 'feature/rewrite_build_sys_tests_v6' into 'master'
Tools: Rewrite build system unit tests to python - git

Closes IDF-7386

See merge request espressif/esp-idf!23860
2023-07-19 01:20:06 +08:00
Marek Fiala
f4e3c9c03a refactor(tools): Rewrite build system unit tests to python
Rewritten parts:
 - git
 - version
 - build
2023-07-18 15:51:04 +02:00
Marek Fiala
e8ee59f68b fix(tools): create-project with proper file permission - pre-commit fix
Closes https://github.com/espressif/esp-idf/pull/11836
2023-07-18 14:08:37 +02:00
Ryan Yin
354e2c4673 feat: fix: create-project & create_component with proper file permission 2023-07-17 19:32:30 +08:00
Marek Fiala
5033637899 Tools: Rewrite build system unit tests to python - partitions, components, docs 2023-06-14 12:17:53 +00:00
Marek Fiala
fb0dc46183 Tools: Rewrite build system unit tests to python - sdkconfig, bootloader, components 2023-05-23 09:47:39 +00:00
Marek Fiala
b4446e1748 Tools: Rewrite build system unit tests to python - cmake libraries and Kconfig 2023-03-28 11:20:42 +02:00
Djordje Nedic
17d1e9ae36 bugfix: Fix windows path case sensitivity
This commit fixes an issue where paths on Windows are case insensitive, for instance when setting the build folder its name would be converted to lowercase.

The culprit is our realpath() function, that was calling os.path.normcase() internally, since we are removing that call it makes sense to just remove the function entirely and call os.path.realpath() wherever necessary.

Closes https://github.com/espressif/esp-idf/issues/10282
2023-01-17 20:51:46 +01:00
KonstantinKondrashov
fd721c5b09 esptool_py: Adds funcs to read eFuses from Cmake during a build stage
Closes https://github.com/espressif/esp-idf/issues/10311
2023-01-04 00:30:38 +08:00
Fu Hanxi
b5d9df8b6f build_system: stop looking for sdkconfig file specified by env var SDKCONFIG_DEFAULTS in bootloader subproject 2022-11-16 16:52:54 +08:00
Ivan Grokhotkov
0503cb52eb build system: add the initial set of pytest-based build system tests 2022-09-16 00:07:55 +02:00