mirror of
https://github.com/esphome/esphome.git
synced 2026-09-30 16:30:22 +00:00
Merge branch 'esp8266-native-build-spec' into esp8266-native-ninja-emission
This commit is contained in:
@@ -449,9 +449,9 @@ def test_load_or_build_idedata_never_caches_a_launcher(
|
||||
data = idedata.load_or_build_idedata(
|
||||
compile_commands, tmp_path / "f.elf", cache
|
||||
)
|
||||
assert data["cxx_path"] == "/opt/homebrew/bin/ccache"
|
||||
assert data is None
|
||||
assert not cache.exists()
|
||||
assert "not caching idedata" in caplog.text
|
||||
assert "no usable idedata" in caplog.text
|
||||
|
||||
|
||||
def test_load_or_build_idedata_cache_hit_skips_rebuild(tmp_path: Path) -> None:
|
||||
|
||||
@@ -263,3 +263,17 @@ def test_run_extra_script_keeps_partial_capture(tmp_path, caplog) -> None:
|
||||
)
|
||||
assert result.libs == ["algobsec"]
|
||||
assert "keeping the partial capture" in caplog.text
|
||||
|
||||
|
||||
def test_run_extra_script_syntax_error_is_best_effort(tmp_path, caplog) -> None:
|
||||
"""A vendored script that does not even compile warns and skips instead
|
||||
of aborting the build."""
|
||||
from esphome.platformio.extra_script import run_extra_script
|
||||
|
||||
script = tmp_path / "extra.py"
|
||||
script.write_text("def broken(:\n")
|
||||
result = run_extra_script(
|
||||
script, library_dir=tmp_path, board_mcu="esp32", pio_platform="espressif32"
|
||||
)
|
||||
assert result.libs == []
|
||||
assert "keeping the partial capture" in caplog.text
|
||||
|
||||
@@ -566,11 +566,9 @@ def test_lex_build_flags_dangling_flag_does_not_cross_entries(
|
||||
assert "Ignoring trailing '-I'" in caplog.text
|
||||
|
||||
|
||||
def test_split_flag_entry_non_string_is_clean( # type: ignore[no-untyped-def]
|
||||
) -> None:
|
||||
def test_split_flag_entry_non_string_is_clean() -> None:
|
||||
"""A dict or number from a third-party manifest fails naming the entry,
|
||||
not with an opaque shlex traceback."""
|
||||
from esphome.core import EsphomeError
|
||||
from esphome.platformio.library import split_flag_entry
|
||||
|
||||
with pytest.raises(EsphomeError, match="Malformed build flag"):
|
||||
|
||||
@@ -178,3 +178,18 @@ def test_print_summary_corrupt_json_warns(
|
||||
size_json.write_text("{not json")
|
||||
print_summary(size_json, partitions_csv=None)
|
||||
assert "Skipping size summary" in caplog.text
|
||||
|
||||
|
||||
def test_print_summary_missing_flash_inputs_warn(
|
||||
tmp_path: Path, caplog: pytest.LogCaptureFixture
|
||||
) -> None:
|
||||
"""Both absent-input paths for the Flash line name their cause."""
|
||||
size_json = _write_size_json(tmp_path, _esp32_size_data())
|
||||
print_summary(size_json, partitions_csv=None)
|
||||
assert "no partition table given" in caplog.text
|
||||
caplog.clear()
|
||||
data = _esp32_size_data()
|
||||
data.pop("image_size", None)
|
||||
size_json = _write_size_json(tmp_path, data)
|
||||
print_summary(size_json, partitions_csv=tmp_path / "partitions.cssv")
|
||||
assert "no image_size" in caplog.text
|
||||
|
||||
Reference in New Issue
Block a user