mirror of
https://github.com/esphome/esphome.git
synced 2026-10-05 10:31:29 +00:00
[esp32] Redefine __FILE__ to the basename so assert paths stay out of RAM (#19106)
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
esphome:
|
||||
name: test
|
||||
|
||||
esp32:
|
||||
board: esp32dev
|
||||
framework:
|
||||
type: esp-idf
|
||||
version: 5.0.6
|
||||
@@ -658,6 +658,27 @@ def test_platformio_arduino_enables_reproducible_build(
|
||||
assert sdkconfig.get("CONFIG_APP_REPRODUCIBLE_BUILD") is True
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("config_file", "expected"),
|
||||
[
|
||||
("reproducible_build.yaml", True),
|
||||
("reproducible_build_arduino.yaml", True),
|
||||
("file_macro_idf_5_0.yaml", False),
|
||||
],
|
||||
)
|
||||
def test_file_macro_is_basename_only(
|
||||
generate_main: Callable[[str | Path], str],
|
||||
component_config_path: Callable[[str], Path],
|
||||
config_file: str,
|
||||
expected: bool,
|
||||
) -> None:
|
||||
"""__FILE__ becomes the basename on GCC 12 toolchains; IDF 5.0 (GCC 11) is skipped."""
|
||||
generate_main(component_config_path(config_file))
|
||||
|
||||
assert ("-D__FILE__=__FILE_NAME__" in CORE.build_flags) is expected
|
||||
assert ("-Wno-builtin-macro-redefined" in CORE.build_flags) is expected
|
||||
|
||||
|
||||
def test_native_idf_enables_reproducible_build(
|
||||
component_config_path: Callable[[str], Path],
|
||||
) -> None:
|
||||
|
||||
Reference in New Issue
Block a user