From f87e4ae577d7c1446f57a20716c3ab4223e8b9ae Mon Sep 17 00:00:00 2001 From: James Harrow Date: Thu, 11 Jan 2024 00:24:29 +0000 Subject: [PATCH] Added option to enable test event triggers for EVSE but in a generic way for future. --- scripts/build/build/targets.py | 1 + scripts/build/builders/host.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 4aaee37d61bbdc..aa11f1e169c35d 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -181,6 +181,7 @@ def BuildHostTarget(): target.AppendModifier('test', extra_tests=True) target.AppendModifier('rpc', enable_rpcs=True) target.AppendModifier('with-ui', imgui_ui=True) + target.AppendModifier('evse-test-event', enable_test_event_triggers=['EVSE']).OnlyIfRe('-energy-management') return target diff --git a/scripts/build/builders/host.py b/scripts/build/builders/host.py index fe3ed2f0fe8a0f..e11d5c2d43779a 100644 --- a/scripts/build/builders/host.py +++ b/scripts/build/builders/host.py @@ -297,7 +297,8 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE, separate_event_loop=True, fuzzing_type: HostFuzzingType = HostFuzzingType.NONE, use_clang=False, interactive_mode=True, extra_tests=False, use_platform_mdns=False, enable_rpcs=False, use_coverage=False, use_dmalloc=False, minmdns_address_policy=None, - minmdns_high_verbosity=False, imgui_ui=False, crypto_library: HostCryptoLibrary = None): + minmdns_high_verbosity=False, imgui_ui=False, crypto_library: HostCryptoLibrary = None, + enable_test_event_triggers=None): super(HostBuilder, self).__init__( root=os.path.join(root, 'examples', app.ExamplePath()), runner=runner) @@ -398,6 +399,10 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE, if crypto_library: self.extra_gn_options.append(crypto_library.gn_argument) + if enable_test_event_triggers is not None: + if 'EVSE' in enable_test_event_triggers: + self.extra_gn_options.append('chip_enable_energy_evse_trigger=true') + if self.board == HostBoard.ARM64: if not use_clang: raise Exception("Cross compile only supported using clang")