(command: _tp.Sequence[str],
*,
cwd=None,
timeout=None,
**kwargs)
| 22 | |
| 23 | |
| 24 | def run_command(command: _tp.Sequence[str], |
| 25 | *, |
| 26 | cwd=None, |
| 27 | timeout=None, |
| 28 | **kwargs) -> None: |
| 29 | _log.info("Running: cd %s && %s", str(cwd), " ".join(command)) |
| 30 | override_timeout = int(_os.environ.get("CPP_TEST_TIMEOUT_OVERRIDDEN", "-1")) |
| 31 | if override_timeout > 0 and (timeout is None or override_timeout > timeout): |
| 32 | _log.info("Overriding the command timeout: %s (before) and %s (after)", |
| 33 | timeout, override_timeout) |
| 34 | timeout = override_timeout |
| 35 | _sp.check_call(command, cwd=cwd, timeout=timeout, **kwargs) |
| 36 | |
| 37 | |
| 38 | # We can't use run_command() because robocopy (Robust Copy, rsync equivalent on Windows) |
no test coverage detected