(cmd, env = None)
| 16 | |
| 17 | |
| 18 | def run_common(cmd, env = None): |
| 19 | cmd_env = env if env is not None else os.environ.copy() |
| 20 | print('Running:', cmd) |
| 21 | |
| 22 | try: |
| 23 | ret = subprocess.run( |
| 24 | cmd, |
| 25 | stdout=subprocess.PIPE, |
| 26 | stderr=subprocess.PIPE, |
| 27 | check=True, |
| 28 | universal_newlines=True, |
| 29 | env=cmd_env |
| 30 | ) |
| 31 | except subprocess.SubprocessError as ex: |
| 32 | print('Could not run "{}"'.format(cmd)) |
| 33 | print("Return code: {}".format(ex.returncode)) |
| 34 | print("stdout: {}".format(ex.stdout)) |
| 35 | print("stderr: {}".format(ex.stderr)) |
| 36 | raise |
| 37 | |
| 38 | |
| 39 | def test_bazel_env_vars(bin_path, guard_path): |
no test coverage detected