diff --git a/tools/test_build_system/test_component_manager.py b/tools/test_build_system/test_component_manager.py index c68131a7b13..ce85dc23283 100644 --- a/tools/test_build_system/test_component_manager.py +++ b/tools/test_build_system/test_component_manager.py @@ -2,11 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 import json import os.path -import textwrap from pathlib import Path -import pytest -from test_build_system_helpers import EXT_IDF_PATH from test_build_system_helpers import IdfPyFunc from test_build_system_helpers import replace_in_file @@ -202,90 +199,3 @@ class TestOptionalDependencyWithKconfig: data = json.load(open(test_app_copy / 'build' / 'project_description.json')) assert ['example__cmp'] == data['build_component_info']['foo']['priv_reqs'] assert ['espressif__mdns'] == data['build_component_info']['foo']['reqs'] - - -# TODO: IDF-14259 - Add root components support to cmakev2 -@pytest.mark.buildv2_skip('Root components (idf_extra_components.yml) not yet supported in cmakev2') -@pytest.mark.revert_later(['tools/idf_extra_components.yml']) -class TestIdfRootDependency: - @pytest.fixture(autouse=True) - def _clean_root_managed(self, clean_root_managed_components: None) -> None: - pass - - def test_basic_build(self, idf_py: IdfPyFunc, test_app_copy: Path) -> None: - with open(os.path.join(EXT_IDF_PATH, 'tools', 'idf_extra_components.yml'), 'w') as fw: - fw.write( - textwrap.dedent(""" - dependencies: - espressif/mdns: "*" - """) - ) - - replace_in_file( - (test_app_copy / 'main' / 'build_test_app.c'), - '// placeholder_before_main', - '#include "mdns.h"', - ) - - replace_in_file( - (test_app_copy / 'main' / 'CMakeLists.txt'), - '# placeholder_inside_idf_component_register', - 'REQUIRES mdns', - ) - - idf_py('build') - - def test_build_only_when_required(self, idf_py: IdfPyFunc, test_app_copy: Path) -> None: - with open(os.path.join(EXT_IDF_PATH, 'tools', 'idf_extra_components.yml'), 'w') as fw: - fw.write( - textwrap.dedent(""" - dependencies: - espressif/mdns: "*" - example/cmp: "*" - """) - ) - - idf_py('reconfigure') - - data = json.load(open(test_app_copy / 'build' / 'project_description.json')) - assert 'espressif__mdns' not in data['build_components'] - assert 'example__cmp' not in data['build_components'] - - replace_in_file( - (test_app_copy / 'main' / 'CMakeLists.txt'), - '# placeholder_inside_idf_component_register', - 'REQUIRES mdns', - ) - - idf_py('reconfigure') - data = json.load(open(test_app_copy / 'build' / 'project_description.json')) - assert 'espressif__mdns' in data['build_components'] - assert 'example__cmp' not in data['build_components'] - - def test_cleanup_unused(self, idf_py: IdfPyFunc, test_app_copy: Path) -> None: - with open(os.path.join(EXT_IDF_PATH, 'tools', 'idf_extra_components.yml'), 'w') as fw: - fw.write( - textwrap.dedent(""" - dependencies: - espressif/mdns: "*" - """) - ) - - idf_py('reconfigure') - data = json.load(open(test_app_copy / 'build' / 'project_description.json')) - assert 'espressif__mdns' in data['all_component_info'] - - with open(os.path.join(EXT_IDF_PATH, 'tools', 'idf_extra_components.yml'), 'w') as fw: - fw.write( - textwrap.dedent(""" - dependencies: - espressif/led_strip: "*" - example/cmp: "*" - """) - ) - - idf_py('reconfigure') - data = json.load(open(test_app_copy / 'build' / 'project_description.json')) - assert 'espressif__led_strip' in data['all_component_info'] - assert 'example__cmp' in data['all_component_info'] - assert 'espressif__mdns' not in data['all_component_info']