mirror of
https://github.com/esphome/esphome.git
synced 2026-10-02 01:10:22 +00:00
Toolchain-suffixed idedata cache, surfaced idedata failures, and per-dump decode warnings
This commit is contained in:
@@ -122,7 +122,7 @@ def test_decode_pc_native_missing_tools_warns_once(
|
||||
"""A stack dump of many addresses produces one missing-tool warning."""
|
||||
from esphome.components import esp8266
|
||||
|
||||
esp8266._warn_missing_decode_tool.cache_clear()
|
||||
esp8266._DECODE_WARNED_AT.clear()
|
||||
with (
|
||||
patch(
|
||||
"esphome.arduino8266.toolchain.get_addr2line_path",
|
||||
@@ -136,4 +136,13 @@ def test_decode_pc_native_missing_tools_warns_once(
|
||||
esp8266._decode_pc({}, "40201234")
|
||||
esp8266._decode_pc({}, "40201238")
|
||||
assert caplog.text.count("Cannot decode crash addresses") == 1
|
||||
esp8266._warn_missing_decode_tool.cache_clear()
|
||||
esp8266._DECODE_WARNED_AT.clear()
|
||||
|
||||
|
||||
def test_resolve_toolchain_rejects_unsupported() -> None:
|
||||
"""ESP8266 rejects a CLI toolchain it cannot serve, like every platform."""
|
||||
from esphome.components.esp8266 import _resolve_toolchain
|
||||
|
||||
CORE.toolchain = Toolchain.SDK_NRF
|
||||
with pytest.raises(cv.Invalid, match="Unsupported toolchain 'sdk-nrf'"):
|
||||
_resolve_toolchain({})
|
||||
|
||||
@@ -212,7 +212,7 @@ def test_get_idedata_delegates(tmp_path: Path) -> None:
|
||||
compile_commands, elf, cache = mock_load.call_args[0]
|
||||
assert compile_commands.name == "compile_commands.json"
|
||||
assert elf.name == "firmware.elf"
|
||||
assert cache.name == "test8266.json"
|
||||
assert cache.name == "test8266.arduino.json"
|
||||
# The exact configured launcher is passed for compile DB parsing
|
||||
assert mock_load.call_args.kwargs["launcher"] == str(Path("/cc/ccache"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user