Match SCons' remaining CPPDEFINES spellings, drop dead test scaffolding

A bare 2-tuple is one name=value pair (not -DFOO -D1), a dict maps
names to values, and a None value is a bare define, per processDefines.
The unused caplog_at_info helper and the progress kwarg the download
stubs declared ahead of their PR are gone.
This commit is contained in:
J. Nick Koston
2026-08-23 21:59:22 -05:00
committed by J. Nick Koston
parent 879cbf6264
commit aa3268a6d8
3 changed files with 43 additions and 25 deletions
@@ -497,6 +497,24 @@ def test_env_unmodelled_subscript_degrades_one_branch(caplog) -> None:
assert env.result.libs == ["still_captured"]
def test_cppdefines_scons_spellings(tmp_path) -> None:
"""A bare 2-tuple is one name=value pair, a dict maps names to values,
and a None value is a bare define (SCons processDefines)."""
env = _FakeSConsEnv(
board_mcu="esp8266", pio_env="esphome_esp8266", pio_platform="espressif8266"
)
env.Append(CPPDEFINES=("FOO", "1"))
env.Append(CPPDEFINES={"BAR": "2", "BAZ": None})
env.Append(CPPDEFINES=["PLAIN"])
flags = captured_as_build_flags(env.result, library_dir=tmp_path)
assert lex_build_flags(flags, "test") == [
"-DFOO=1",
"-DBAR=2",
"-DBAZ",
"-DPLAIN",
]
def test_uncaptured_append_key_warns_once(caplog) -> None:
"""A loop of Appends to the same uncaptured key warns once."""