Skip to content

Commit 54cb663

Browse files
committed
ci: add idf_as_lib to patterns-build_system rules
The `idf_as_lib` example is used and tested in `tools/test_build_system/test_cmake.py`. Include `idf_as_lib` in the build_system rules to ensure the tests are executed whenever there is a modification in the `idf_as_lib` example. Expand the `test_build_custom_cmake_project` test to cover all supported targets, including host build. Signed-off-by: Frantisek Hrbata <[email protected]>
1 parent 3b28818 commit 54cb663

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tools/test_build_system/test_cmake.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
1+
# SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
22
# SPDX-License-Identifier: Apache-2.0
33
import logging
44
import os
@@ -16,14 +16,17 @@
1616

1717
def test_build_custom_cmake_project(test_app_copy: Path) -> None:
1818
# Test is compatible with any target. Random targets in the list are selected for performance reasons
19-
for target in ['esp32', 'esp32s3', 'esp32c6', 'esp32h2']:
19+
idf_path = Path(os.environ['IDF_PATH'])
20+
for target in ['esp32','esp32c2','esp32c3','esp32c6','esp32h2','esp32p4','esp32s2','esp32s3']:
2021
logging.info(f'Test build ESP-IDF as a library to a custom CMake projects for {target}')
21-
idf_path = Path(os.environ['IDF_PATH'])
2222
run_cmake_and_build(str(idf_path / 'examples' / 'build_system' / 'cmake' / 'idf_as_lib'), '-G', 'Ninja',
2323
'-DCMAKE_TOOLCHAIN_FILE={}'.format(idf_path / 'tools' / 'cmake' / f'toolchain-{target}.cmake'), f'-DTARGET={target}')
2424
assert file_contains((test_app_copy / 'build' / 'compile_commands.json'), '"command"')
2525
shutil.rmtree(test_app_copy / 'build')
2626

27+
logging.info(f'Test build ESP-IDF as a library to a custom CMake projects for host')
28+
run_cmake_and_build(str(idf_path / 'examples' / 'build_system' / 'cmake' / 'idf_as_lib'), '-G', 'Ninja')
29+
2730

2831
def test_build_cmake_library_psram_workaround(test_app_copy: Path) -> None:
2932
logging.info('Building a project with CMake library imported and PSRAM workaround, all files compile with workaround')

0 commit comments

Comments
 (0)