MCPcopy Create free account
hub / github.com/pytorch/executorch / _run_cmd

Function _run_cmd

backends/arm/test/runner_utils.py:675–693  ·  view source on GitHub ↗

Run a command and check for errors. Args: cmd (List[str]): The command to run as a list.

(
    cmd: List[str], check=True, env: dict[str, str] | None = None
)

Source from the content-addressed store, hash-verified

673
674
675def _run_cmd(
676 cmd: List[str], check=True, env: dict[str, str] | None = None
677) -> subprocess.CompletedProcess[bytes]:
678 """Run a command and check for errors.
679
680 Args:
681 cmd (List[str]): The command to run as a list.
682
683 """
684 try:
685 result = subprocess.run( # nosec B603 - cmd constructed from trusted inputs
686 cmd, check=check, capture_output=True, env=env
687 )
688 return result
689 except subprocess.CalledProcessError as e:
690 arg_string = " ".join(cmd)
691 raise RuntimeError(
692 f"Failed running command {arg_string}\nStderr: {e.stderr.decode()}\nStdout: {e.stdout.decode()}"
693 )
694
695
696# Name of an optional resource containing the `flatc` executable.

Callers 5

run_vkml_emulation_layerFunction · 0.85
run_corstoneFunction · 0.85
corstone300_installedFunction · 0.85
corstone320_installedFunction · 0.85

Calls 2

runMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected