Parse the benchmark example command-line string into a dictionary of command-line arguments
(commandline: str)
| 466 | |
| 467 | |
| 468 | def parse_benchmark_commandline(commandline: str) -> Dict[str, str]: |
| 469 | """ Parse the benchmark example command-line string into a dictionary of command-line arguments |
| 470 | """ |
| 471 | # Separate the data type option from the example_args portion of the string |
| 472 | commandline = commandline.replace(",--type=", " --type=") |
| 473 | |
| 474 | args = commandline.split() |
| 475 | # Discard program name |
| 476 | args = args[1:] |
| 477 | # Split into a list of (argument name, argument value) |
| 478 | args = map(lambda arg: arg.split("="), args) |
| 479 | |
| 480 | def transform(_name): |
| 481 | # Strip '-'/"--" if it exists |
| 482 | _name = _name.lstrip("-") |
| 483 | return _name |
| 484 | |
| 485 | return {transform(name): val for name, val in args} |
| 486 | |
| 487 | |
| 488 | def extract_benchmark_results( |
no test coverage detected