mirror of
https://github.com/esphome/esphome.git
synced 2026-10-07 03:16:37 +00:00
Merge branch 'esp8266-native-ninja-emission' into esp8266-arduino-toolchain
This commit is contained in:
@@ -346,7 +346,7 @@ def test_write_project_link_line_and_exclusions(tmp_path: Path) -> None:
|
||||
assert "core_esp8266_waveform_phase.cpp" not in content
|
||||
assert "core_esp8266_main.cpp.o" in content
|
||||
# Assembly and C sources compile through their own rules
|
||||
assert "cont.S.o: asm" in content
|
||||
assert "cont.S.o: aspp" in content
|
||||
assert "abi.c.o: c" in content
|
||||
# throw_stubs is force-included for ESPHome sources only, via one shared
|
||||
# srcflags variable rather than a copy of the flags line per edge
|
||||
@@ -688,6 +688,30 @@ def test_build_config_nonosdk_precedence() -> None:
|
||||
assert _resolve_build_config(_defines()).nonosdk == "NONOSDK221"
|
||||
|
||||
|
||||
def test_write_project_plain_asm_rule_skips_preprocessor(tmp_path: Path) -> None:
|
||||
"""A lowercase .s source assembles plain (SCons AS), never through the
|
||||
preprocessor rule that a .S source gets."""
|
||||
paths = _make_framework(tmp_path)
|
||||
core_dir = paths.framework / "cores" / "esp8266"
|
||||
(core_dir / "lowlevel.s").write_text("nop\n")
|
||||
_set_flags()
|
||||
content = _write_ninja(paths)
|
||||
assert "lowlevel.s.o: asm " in content
|
||||
assert "rule asm\n command = $ccache $cc -x assembler $asflags -c $in -o $out" in (
|
||||
content
|
||||
)
|
||||
|
||||
|
||||
def test_write_project_unflags_operandless_linker_flag(tmp_path: Path) -> None:
|
||||
"""build_unflags: -nostdlib filters whole-token from both lines, as
|
||||
PlatformIO allows; only operand-taking flags hard-error."""
|
||||
paths = _make_framework(tmp_path)
|
||||
_set_flags()
|
||||
CORE.build_unflags = {"-nostdlib"}
|
||||
content = _write_ninja(paths)
|
||||
assert "-nostdlib" not in content
|
||||
|
||||
|
||||
def test_write_project_unflagged_symbol_takes_its_dash_u(tmp_path: Path) -> None:
|
||||
"""Unflagging a -u symbol drops the -u that carried it; a dangling -u
|
||||
would consume the next token and hand ld a symbol as an input file."""
|
||||
|
||||
@@ -909,12 +909,12 @@ def test_split_flag_entry_non_string_is_clean() -> None:
|
||||
|
||||
|
||||
def test_source_kind_map_shape() -> None:
|
||||
"""The kind values the native compile rules key on, and the deliberate
|
||||
AS/ASPP merge (.s and .S both map to asm)."""
|
||||
"""The kind values the native compile rules key on; the AS/ASPP split
|
||||
matches SCons (.S preprocessed, .s plain assembler)."""
|
||||
|
||||
assert set(SOURCE_KIND_FOR_SUFFIX.values()) == {"c", "cxx", "asm"}
|
||||
assert set(SOURCE_KIND_FOR_SUFFIX.values()) == {"c", "cxx", "asm", "aspp"}
|
||||
assert SOURCE_KIND_FOR_SUFFIX[".s"] == "asm"
|
||||
assert SOURCE_KIND_FOR_SUFFIX[".S"] == "asm"
|
||||
assert SOURCE_KIND_FOR_SUFFIX[".S"] == "aspp"
|
||||
assert SOURCE_KIND_FOR_SUFFIX[".c"] == "c"
|
||||
assert SOURCE_KIND_FOR_SUFFIX[".cpp"] == "cxx"
|
||||
# SCons's case-sensitive C++ suffixes: PIO compiles .C as C++
|
||||
|
||||
Reference in New Issue
Block a user