From a15dbe750f70126dd6278d29417a65e13471994a Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 23 Aug 2026 17:46:53 -0500 Subject: [PATCH] Pin that a non-default flash mode reaches the define and the image header --- tests/unit_tests/build_gen/test_arduino8266.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/unit_tests/build_gen/test_arduino8266.py b/tests/unit_tests/build_gen/test_arduino8266.py index e75908eee9..4a75b42fd6 100644 --- a/tests/unit_tests/build_gen/test_arduino8266.py +++ b/tests/unit_tests/build_gen/test_arduino8266.py @@ -245,6 +245,19 @@ def test_write_project_rejects_bad_flash_mode(tmp_path: Path) -> None: _write_ninja(paths) +def test_write_project_flash_mode_reaches_define_and_elf2bin( + tmp_path: Path, +) -> None: + """A non-default board_flash_mode lands in both the compile define and + the elf2bin image header, never silently falling back to dout.""" + paths = _make_framework(tmp_path) + CORE.platformio_options["board_build.flash_mode"] = "dio" + content = _write_ninja(paths) + assert "-DFLASHMODE_DIO" in content + assert "--flash_mode dio" in content + assert "FLASHMODE_DOUT" not in content + + def test_write_project_trailing_include_raises(tmp_path: Path) -> None: """A dangling -include must fail by name, not become -include .""" paths = _make_framework(tmp_path)