Skip to content

Commit

Permalink
[chiptool.py] Forward extra parameters to the runner (#26017)
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien-apple authored and pull[bot] committed Oct 6, 2023
1 parent 9ca98ca commit 5243049
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions scripts/tests/yaml/chiptool.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,19 @@


@click.pass_context
def send_yaml_command(ctx, test_name: str, server_path: str, server_arguments: str, pics: str):
parser_builder_config = ctx.invoke(runner_base, test_name=test_name, pics=pics)
def send_yaml_command(ctx, test_name: str, server_path: str, server_arguments: str, pics: str, commands: list[str]):
kwargs = {'test_name': test_name, 'pics': pics}

index = 0
while len(commands) - index > 1:
kwargs[commands[index].replace('--', '')] = commands[index+1]
index += 2
ctx.invoke(runner_base, **kwargs)

del ctx.params['commands']
del ctx.params['pics']
return ctx.forward(chiptool, parser_builder_config)

return ctx.forward(chiptool)


def send_raw_command(command: str, server_path: str, server_arguments: str):
Expand Down Expand Up @@ -88,7 +95,7 @@ def chiptool_py(ctx, commands: list[str], server_path: str, server_name: str, se
success = False

if len(commands) > 1 and commands[0] == 'tests':
success = send_yaml_command(commands[1], server_path, server_arguments, pics)
success = send_yaml_command(commands[1], server_path, server_arguments, pics, commands[2:])
else:
if server_path is None and server_name:
paths_finder = PathsFinder()
Expand Down

0 comments on commit 5243049

Please sign in to comment.