mirror of
https://github.com/esphome/esphome.git
synced 2026-10-03 09:46:03 +00:00
[cpptests] support testing platform components (#13075)
Co-authored-by: J. Nick Koston <nick@home-assistant.io> Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
co-authored by
J. Nick Koston
J. Nick Koston
parent
00f809f5f0
commit
e82f0f4432
@@ -71,6 +71,11 @@ class ComponentManifest:
|
||||
|
||||
@property
|
||||
def to_code(self) -> Callable[[Any], None] | None:
|
||||
if CORE.cpp_testing:
|
||||
# During C++ testing, only run to_code for allowlisted components
|
||||
name = self.module.__package__.rsplit(".", 1)[-1]
|
||||
if name not in CORE.cpp_testing_codegen:
|
||||
return None
|
||||
return getattr(self.module, "to_code", None)
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user