(binary, cache, args, stdin=None, timeout=120)
| 40 | |
| 41 | |
| 42 | def run_cli(binary, cache, args, stdin=None, timeout=120): |
| 43 | env = dict(os.environ) |
| 44 | env["CBM_CACHE_DIR"] = cache |
| 45 | env["CBM_RUNTIME_DIR"] = os.path.join(cache, "runtime") |
| 46 | return subprocess.run([binary] + args, capture_output=True, timeout=timeout, |
| 47 | env=env, input=stdin) |
| 48 | |
| 49 | |
| 50 | def main(): |