mirror of
https://github.com/esphome/esphome.git
synced 2026-10-06 10:56:43 +00:00
Match glob archive specs in the fragment belt and quote the list expansion
This commit is contained in:
@@ -173,6 +173,8 @@ def test_get_project_cmakelists_emits_ldgen_override(
|
||||
monkeypatch.delenv("ESPHOME_LDGEN_STRICT", raising=False)
|
||||
content = _render(minimal=minimal)
|
||||
assert "REMOVE_ITEM ${out_list_var} idf::src __idf_src" in content
|
||||
# Quoted so spaced elements survive and an empty list stays defined
|
||||
assert 'set(${out_list_var} "${${out_list_var}}" PARENT_SCOPE)' in content
|
||||
assert 'message(WARNING "ESPHome ldgen app archive exclusion' in content
|
||||
assert 'message(STATUS "ESPHome ldgen override target not found' in content
|
||||
assert 'message(WARNING "ESPHome ldgen override never filtered' in content
|
||||
|
||||
@@ -690,13 +690,28 @@ def test_warn_if_app_archive_mapped_strict_raises(
|
||||
toolchain._warn_if_app_archive_mapped()
|
||||
|
||||
|
||||
def test_warn_if_app_archive_mapped_glob(
|
||||
setup_core: Path, tmp_path: Path, caplog: pytest.LogCaptureFixture
|
||||
) -> None:
|
||||
"""A glob archive spec that selects the app archive is also flagged."""
|
||||
_setup_build(setup_core)
|
||||
frag = tmp_path / "linker.lf"
|
||||
frag.write_text("[mapping:evil]\narchive: lib*\n")
|
||||
_write_fragments_build_ninja(tmp_path, [frag])
|
||||
toolchain._warn_if_app_archive_mapped()
|
||||
assert "maps the app archive" in caplog.text
|
||||
|
||||
|
||||
def test_warn_if_app_archive_mapped_clean(
|
||||
setup_core: Path, tmp_path: Path, caplog: pytest.LogCaptureFixture
|
||||
) -> None:
|
||||
"""Normal fragments produce no warning."""
|
||||
"""Normal fragments, including IDF's stock archive: * catch-all,
|
||||
produce no warning."""
|
||||
_setup_build(setup_core)
|
||||
frag = tmp_path / "linker.lf"
|
||||
frag.write_text("[mapping:freertos]\narchive: libfreertos.a\n")
|
||||
frag.write_text(
|
||||
"[mapping:freertos]\narchive: libfreertos.a\n[mapping:default]\narchive: *\n"
|
||||
)
|
||||
_write_fragments_build_ninja(tmp_path, [frag])
|
||||
toolchain._warn_if_app_archive_mapped()
|
||||
assert "maps the app archive" not in caplog.text
|
||||
|
||||
Reference in New Issue
Block a user