mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
chore: Remove old root managed components tests
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -195,84 +192,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']
|
||||
|
||||
|
||||
@pytest.mark.revert_later(['tools/idf_extra_components.yml'])
|
||||
class TestIdfRootDependency:
|
||||
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']
|
||||
|
||||
Reference in New Issue
Block a user