mirror of
https://github.com/esphome/esphome.git
synced 2026-10-07 19:44:08 +00:00
28 lines
885 B
Python
28 lines
885 B
Python
"""LN882x builds with 1-byte enums to match the SDK's prebuilt libraries;
|
|
the other LibreTiny families keep LibreTiny's own enum size."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from collections.abc import Callable
|
|
from pathlib import Path
|
|
|
|
from esphome.core import CORE
|
|
|
|
|
|
def test_ln882x_swaps_in_short_enums(
|
|
generate_main: Callable[[str | Path], str],
|
|
component_config_path: Callable[[str], Path],
|
|
) -> None:
|
|
generate_main(component_config_path("ln882x.yaml"))
|
|
assert "-fno-short-enums" in CORE.build_unflags
|
|
assert "-fshort-enums" in CORE.build_flags
|
|
|
|
|
|
def test_bk72xx_keeps_libretiny_enums(
|
|
generate_main: Callable[[str | Path], str],
|
|
component_config_path: Callable[[str], Path],
|
|
) -> None:
|
|
generate_main(component_config_path("bk72xx.yaml"))
|
|
assert "-fno-short-enums" not in CORE.build_unflags
|
|
assert "-fshort-enums" not in CORE.build_flags
|