Merge branch 'esp8266-native-framework-installer' into esp8266-native-library-backend

This commit is contained in:
J. Nick Koston
2026-08-23 19:30:47 -05:00
4 changed files with 59 additions and 7 deletions
@@ -830,6 +830,7 @@ def test_normalize_dependencies_forms(caplog) -> None:
{"name": "A", "build": {"srcDir": 123}},
{"name": "A", "build": {"includeDir": ["inc"]}},
{"name": "A", "build": {"srcFilter": {"+": "src"}}},
{"name": "A", "ESPHOME": {"LINK_FLAGS": "-Wl,-x"}},
],
)
def test_convert_libraries_malformed_manifest_raises(
@@ -842,6 +843,29 @@ def test_convert_libraries_malformed_manifest_raises(
convert_libraries([Library("esphome/A", None, None)], _backend())
def test_convert_libraries_malformed_transitive_dep_skips(
tmp_path, monkeypatch, caplog: pytest.LogCaptureFixture
) -> None:
"""A malformed manifest on a dependency the user never asked for warns
and skips; only a top-level library fails the build."""
_patch_download_with_manifests(
monkeypatch,
tmp_path,
{
"esphome/A": {
"name": "A",
"dependencies": [{"name": "B", "owner": "esphome", "version": "1.0"}],
},
"esphome/B": {"name": "B", "build": {"srcDir": 123}},
},
)
components = convert_libraries([Library("esphome/A", None, None)], _backend())
names = [c.name for c in components]
assert "esphome/A" in names
assert "esphome/B" not in names
assert "Skipping dependency esphome/B: malformed manifest" in caplog.text
def test_walk_warns_for_properties_only_depends(
tmp_path, monkeypatch, caplog: pytest.LogCaptureFixture
) -> None:
+12
View File
@@ -66,6 +66,18 @@ def test_generate_cmakelists_txt_flags_and_includes(tmp_path):
assert "-lm" in out
def test_generate_cmakelists_txt_escapes_embedded_quotes(tmp_path):
"""A define value carrying a literal quote (reachable via the lex
round-trip) survives as an escaped quote, not a broken CMake string."""
c = _make_component(tmp_path)
(tmp_path / "src").mkdir()
(tmp_path / "src" / "a.c").write_text("")
c.data = {"build": {"flags": ['-DMSG=\\"hi\\"']}}
out = generate_cmakelists_txt(c)
assert '"-DMSG=\\"hi\\""' in out
def test_generate_cmakelists_txt_lexes_spaced_flags(tmp_path):
"""A spaced -I entry routes to include dirs instead of landing verbatim
in compile options; same shared lexer as the espidf emitter."""