mirror of
https://github.com/esphome/esphome.git
synced 2026-10-01 08:50:22 +00:00
[libretiny] Enable the PlatformIO precompiled header on Linux hosts (#19827)
This commit is contained in:
@@ -109,14 +109,27 @@ def test_pch_checksum_tracks_closure_content(tmp_path: Path) -> None:
|
||||
assert base != pch.pch_checksum(tmp_path, ["root.h"], ["id"])
|
||||
|
||||
|
||||
@pytest.mark.parametrize("platform", ["esp32", "esp8266", "rp2"])
|
||||
@pytest.mark.parametrize(
|
||||
"platform", ["bk72xx", "esp32", "esp8266", "ln882x", "rp2", "rtl87xx"]
|
||||
)
|
||||
def test_pch_script_enabled(platform: str, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
monkeypatch.setattr(pch.sys, "platform", "linux")
|
||||
CORE.data[KEY_CORE] = {KEY_TARGET_PLATFORM: platform}
|
||||
assert pch.pch_script_enabled()
|
||||
monkeypatch.setenv("ESPHOME_PCH_ENABLE", "0")
|
||||
assert not pch.pch_script_enabled()
|
||||
|
||||
|
||||
@pytest.mark.parametrize("host", ["darwin", "win32"])
|
||||
@pytest.mark.parametrize("platform", sorted(pch.PCH_SCRIPT_LINUX_ONLY_PLATFORMS))
|
||||
def test_pch_script_linux_only_platform(
|
||||
platform: str, host: str, monkeypatch: pytest.MonkeyPatch
|
||||
) -> None:
|
||||
monkeypatch.setattr(pch.sys, "platform", host)
|
||||
CORE.data[KEY_CORE] = {KEY_TARGET_PLATFORM: platform}
|
||||
assert not pch.pch_script_enabled()
|
||||
|
||||
|
||||
@pytest.mark.parametrize("platform", sorted(pch.PCH_SCRIPT_EXCLUDED_PLATFORMS))
|
||||
def test_pch_script_excluded_platform(platform: str) -> None:
|
||||
CORE.data[KEY_CORE] = {KEY_TARGET_PLATFORM: platform}
|
||||
|
||||
Reference in New Issue
Block a user