mirror of
https://github.com/esphome/esphome.git
synced 2026-06-24 13:43:00 +00:00
[esp32] Make ESP-IDF the default toolchain (#16910)
This commit is contained in:
@@ -5,5 +5,6 @@ esp32:
|
||||
board: esp32dev
|
||||
flash_mode: qio
|
||||
flash_frequency: 80MHz
|
||||
toolchain: platformio
|
||||
framework:
|
||||
type: esp-idf
|
||||
|
||||
@@ -64,6 +64,38 @@ def test_esp32_config(
|
||||
assert VARIANT_FRIENDLY[variant].lower() in config["board"]
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("config_toolchain", "expected"),
|
||||
[
|
||||
# No `toolchain:` set -> the new default for esp32.
|
||||
(None, Toolchain.ESP_IDF),
|
||||
# An explicit `toolchain:` still wins over the default.
|
||||
(Toolchain.PLATFORMIO.value, Toolchain.PLATFORMIO),
|
||||
(Toolchain.ESP_IDF.value, Toolchain.ESP_IDF),
|
||||
],
|
||||
)
|
||||
def test_esp32_default_toolchain_is_esp_idf(
|
||||
set_core_config: SetCoreConfigCallable,
|
||||
config_toolchain: str | None,
|
||||
expected: Toolchain,
|
||||
) -> None:
|
||||
"""With no `toolchain:` set (and nothing pinned via the CLI), esp32 resolves
|
||||
to the ESP-IDF toolchain; an explicit `toolchain:` still wins."""
|
||||
set_core_config(PlatformFramework.ESP32_IDF)
|
||||
|
||||
from esphome.components.esp32 import CONFIG_SCHEMA
|
||||
|
||||
# Fresh run: no --toolchain CLI and no prior config pinned CORE.toolchain.
|
||||
CORE.toolchain = None
|
||||
config: dict[str, Any] = {"variant": VARIANT_ESP32}
|
||||
if config_toolchain is not None:
|
||||
config["toolchain"] = config_toolchain
|
||||
|
||||
CONFIG_SCHEMA(config)
|
||||
|
||||
assert CORE.toolchain == expected
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("config", "error_match"),
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user