mirror of
https://github.com/esphome/esphome.git
synced 2026-10-02 01:10:22 +00:00
Merge branch 'esp8266-native-ninja-emission' into esp8266-arduino-toolchain
This commit is contained in:
@@ -461,6 +461,31 @@ def test_library_info_lib_archive_parse(
|
||||
assert lib.lib_archive is expected
|
||||
|
||||
|
||||
def test_library_info_dropped_link_fields_warn(
|
||||
tmp_path: Path, caplog: pytest.LogCaptureFixture
|
||||
) -> None:
|
||||
"""precompiled/ldflags properties are not honored; the drop is named."""
|
||||
read_path = tmp_path / "lib"
|
||||
(read_path / "src").mkdir(parents=True)
|
||||
component._library_info(
|
||||
"x", read_path, {"precompiled": "true", "ldflags": "-lfoo", "build": {}}
|
||||
)
|
||||
assert "declares precompiled, which this backend does not honor" in caplog.text
|
||||
assert "declares ldflags, which this backend does not honor" in caplog.text
|
||||
|
||||
|
||||
def test_library_info_unmapped_sources_warn(
|
||||
tmp_path: Path, caplog: pytest.LogCaptureFixture
|
||||
) -> None:
|
||||
"""Matched files that all fall through the suffix map are visible; an
|
||||
empty archive would fail far away at link."""
|
||||
read_path = tmp_path / "lib"
|
||||
(read_path / "src").mkdir(parents=True)
|
||||
(read_path / "src" / "impl.CPP").write_text("")
|
||||
component._library_info("x", read_path, {"build": {}})
|
||||
assert "no matched file has a recognized source suffix" in caplog.text
|
||||
|
||||
|
||||
def test_library_info_lib_archive_malformed_raises(tmp_path: Path) -> None:
|
||||
"""A typo'd libArchive fails by name like the other build fields."""
|
||||
read_path = tmp_path / "lib"
|
||||
@@ -645,18 +670,6 @@ def test_dict_shorthand_dependency_skips_registry_through_real_converter(
|
||||
assert any("locallib" in n.lower() for n in names)
|
||||
|
||||
|
||||
def test_converted_properties_depends_warns(
|
||||
tmp_path: Path, caplog: pytest.LogCaptureFixture
|
||||
) -> None:
|
||||
"""A converted library shipping only the properties depends= spelling
|
||||
is visible, not a silent bundled-dependency drop."""
|
||||
framework = _make_framework(tmp_path)
|
||||
converted = _webserver(tmp_path, {"build": {}, "depends": "Wire,SPI"})
|
||||
with _emitting_converter(converted):
|
||||
_resolve(framework)
|
||||
assert "declares dependencies via library.properties" in caplog.text
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("bad_name", "message"),
|
||||
[
|
||||
|
||||
@@ -666,6 +666,40 @@ def test_convert_libraries_malformed_manifest_raises(
|
||||
convert_libraries([Library("esphome/A", None, None)], _backend())
|
||||
|
||||
|
||||
def test_walk_warns_for_properties_only_depends(
|
||||
tmp_path, monkeypatch, caplog: pytest.LogCaptureFixture
|
||||
) -> None:
|
||||
"""A manifest declaring dependencies only as library.properties depends=
|
||||
warns in the shared walk, so every backend reports the drop."""
|
||||
_patch_download_with_manifests(
|
||||
monkeypatch,
|
||||
tmp_path,
|
||||
{"esphome/A": "name=A\nversion=1.0\ndepends=Wire, SPI\n"},
|
||||
properties=("esphome/A",),
|
||||
)
|
||||
convert_libraries([Library("esphome/A", "1.0.0", None)], _backend())
|
||||
assert "declares dependencies via library.properties" in caplog.text
|
||||
|
||||
|
||||
def test_versionless_platform_filtered_dependency_stays_quiet(
|
||||
tmp_path, monkeypatch, caplog: pytest.LogCaptureFixture
|
||||
) -> None:
|
||||
"""A version-less dependency the platform filter excludes is
|
||||
deliberately absent, not a drop to warn about."""
|
||||
_patch_download_with_manifests(
|
||||
monkeypatch,
|
||||
tmp_path,
|
||||
{
|
||||
"esphome/A": {
|
||||
"name": "A",
|
||||
"dependencies": [{"name": "Hash", "platforms": "espressif8266"}],
|
||||
}
|
||||
},
|
||||
)
|
||||
convert_libraries([Library("esphome/A", None, None)], _backend())
|
||||
assert "has no version to resolve" not in caplog.text
|
||||
|
||||
|
||||
def test_versionless_ignored_dependency_stays_quiet(
|
||||
tmp_path, monkeypatch, caplog: pytest.LogCaptureFixture
|
||||
) -> None:
|
||||
|
||||
Reference in New Issue
Block a user