diff --git a/tools/test_build_system/buildv2_test_app/CMakeLists.txt b/tools/test_build_system/buildv2_test_app/CMakeLists.txt new file mode 100644 index 00000000000..f1f85a52508 --- /dev/null +++ b/tools/test_build_system/buildv2_test_app/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.22) + +# placeholder_before_include_project_cmake + +include($ENV{IDF_PATH}/tools/cmakev2/idf.cmake) + +# placeholder_after_include_project_cmake + +# FIXME: Replace the following with idf_project_default when it becomes +# available. +project(buildv2_test_app C CXX ASM) + +__generate_project_info() diff --git a/tools/test_build_system/buildv2_test_app/README.md b/tools/test_build_system/buildv2_test_app/README.md new file mode 100644 index 00000000000..faf3c22837b --- /dev/null +++ b/tools/test_build_system/buildv2_test_app/README.md @@ -0,0 +1 @@ +Information about this test app can be found [here](../README.md#application-under-test). diff --git a/tools/test_build_system/buildv2_test_app/main/CMakeLists.txt b/tools/test_build_system/buildv2_test_app/main/CMakeLists.txt new file mode 100644 index 00000000000..1ba9a7a9e71 --- /dev/null +++ b/tools/test_build_system/buildv2_test_app/main/CMakeLists.txt @@ -0,0 +1,5 @@ +# placeholder_before_idf_component_register + +idf_component_register(SRCS "buildv2_test_app.c" + # placeholder_inside_idf_component_register +) diff --git a/tools/test_build_system/buildv2_test_app/main/Kconfig.projbuild b/tools/test_build_system/buildv2_test_app/main/Kconfig.projbuild new file mode 100644 index 00000000000..4c7e3fb2446 --- /dev/null +++ b/tools/test_build_system/buildv2_test_app/main/Kconfig.projbuild @@ -0,0 +1,4 @@ +# Misspelled Kconfig file checks whether it is picked up by the build system +config FROM_MISSPELLED_KCONFIG + bool "From misspelled Kconfig" + default y diff --git a/tools/test_build_system/buildv2_test_app/main/buildv2_test_app.c b/tools/test_build_system/buildv2_test_app/main/buildv2_test_app.c new file mode 100644 index 00000000000..9e60b06490b --- /dev/null +++ b/tools/test_build_system/buildv2_test_app/main/buildv2_test_app.c @@ -0,0 +1,12 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +#include +// placeholder_before_main + +void app_main(void) +{ + // placeholder_inside_main +} diff --git a/tools/test_build_system/conftest.py b/tools/test_build_system/conftest.py index 865c018863d..d40148917bd 100644 --- a/tools/test_build_system/conftest.py +++ b/tools/test_build_system/conftest.py @@ -44,6 +44,11 @@ def pytest_addoption(parser: pytest.Parser) -> None: '--cleanup-idf-copy', action='store_true', help='Always clean up the IDF copy after the test. By default, the copy is cleaned up only if the test passes.' ) + parser.addoption( + '--buildv2', + action='store_true', + help='Use the IDF build system v2 project for testing.', + ) @pytest.fixture(scope='session') @@ -94,7 +99,10 @@ def work_dir(request: FixtureRequest, _session_work_dir: typing.Tuple[Path, bool def test_app_copy(func_work_dir: Path, request: FixtureRequest) -> typing.Generator[Path, None, None]: # by default, use hello_world app and copy it to a temporary directory with # the name resembling that of the test - copy_from = 'tools/test_build_system/build_test_app' + if request.config.getoption('buildv2', False): + copy_from = 'tools/test_build_system/buildv2_test_app' + else: + copy_from = 'tools/test_build_system/build_test_app' # sanitize test name in case pytest.mark.parametrize was used test_name_sanitized = request.node.name.replace('[', '_').replace(']', '') copy_to = test_name_sanitized + '_app'