mirror of
https://github.com/esphome/esphome.git
synced 2026-08-29 09:13:28 +00:00
The contract test's own #define only covers its translation unit; ble_gatt_client.cpp needs the define from the build to link the find_characteristic/find_cccd definitions the lookup tests call.
16 lines
701 B
Python
16 lines
701 B
Python
import esphome.codegen as cg
|
|
from tests.testing_helpers import ComponentManifestOverride
|
|
|
|
|
|
def override_manifest(manifest: ComponentManifestOverride) -> None:
|
|
# resolve_irk() is compiled only when a sensor configures irk:
|
|
# (request_irk_support() emits USE_BLE_DEVICE_IRK). The unit-test build has
|
|
# no sensors, so emit the define here to put the real IRK path under test.
|
|
async def to_code_testing(config):
|
|
cg.add_define("USE_BLE_DEVICE_IRK")
|
|
# The gatt contract test exercises the gated lookup helpers; compile
|
|
# their definitions (ble_gatt_client.cpp) into the test build.
|
|
cg.add_define("USE_BLE_GATT_CLIENT")
|
|
|
|
manifest.to_code = to_code_testing
|