Skip to content

Commit 9c90f0f

Browse files
authored
[chiptool.py] Add show_adapter_logs option to chiptool.py (project-chip#28258)
1 parent d9a747b commit 9c90f0f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

scripts/tests/yaml/chiptool.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@
3232

3333

3434
@click.pass_context
35-
def send_yaml_command(ctx, test_name: str, server_path: str, server_arguments: str, pics: str, additional_pseudo_clusters_directory: str, commands: List[str]):
36-
kwargs = {'test_name': test_name, 'pics': pics, 'additional_pseudo_clusters_directory': additional_pseudo_clusters_directory}
35+
def send_yaml_command(ctx, test_name: str, server_path: str, server_arguments: str, show_adapter_logs: bool, pics: str, additional_pseudo_clusters_directory: str, commands: List[str]):
36+
kwargs = {'test_name': test_name, 'show_adapter_logs': show_adapter_logs, 'pics': pics,
37+
'additional_pseudo_clusters_directory': additional_pseudo_clusters_directory}
3738

3839
index = 0
3940
while len(commands) - index > 1:
@@ -83,6 +84,8 @@ def chiptool_runner_options(f):
8384
help='Name of a websocket server to run at launch.')(f)
8485
f = click.option('--server_arguments', type=str, default='interactive server',
8586
help='Optional arguments to pass to the websocket server at launch.')(f)
87+
f = click.option('--show_adapter_logs', type=bool, default=False, show_default=True,
88+
help='Show additional logs provided by the adapter.')(f)
8689
f = click.option('--trace_file', type=click.Path(), default=None,
8790
help='Optional file path to save the tracing output to.')(f)
8891
f = click.option('--trace_decode', type=bool, default=True,
@@ -126,14 +129,14 @@ def maybe_update_stop_on_error(ctx):
126129
@click.argument('commands', nargs=-1)
127130
@chiptool_runner_options
128131
@click.pass_context
129-
def chiptool_py(ctx, commands: List[str], server_path: str, server_name: str, server_arguments: str, trace_file: str, trace_decode: bool, delay_in_ms: int, continueonfailure: bool, pics: str, additional_pseudo_clusters_directory: str):
132+
def chiptool_py(ctx, commands: List[str], server_path: str, server_name: str, server_arguments: str, show_adapter_logs: bool, trace_file: str, trace_decode: bool, delay_in_ms: int, continueonfailure: bool, pics: str, additional_pseudo_clusters_directory: str):
130133
success = False
131134

132135
server_arguments = maybe_update_server_arguments(ctx)
133136
maybe_update_stop_on_error(ctx)
134137

135138
if len(commands) > 1 and commands[0] == 'tests':
136-
success = send_yaml_command(commands[1], server_path, server_arguments, pics,
139+
success = send_yaml_command(commands[1], server_path, server_arguments, show_adapter_logs, pics,
137140
additional_pseudo_clusters_directory, commands[2:])
138141
else:
139142
if server_path is None and server_name:

0 commit comments

Comments
 (0)