(command: &str, args: &[&str], cwd: &Path)
| 9749 | } |
| 9750 | |
| 9751 | fn command_output(command: &str, args: &[&str], cwd: &Path) -> Result<String> { |
| 9752 | let output = Command::new(command) |
| 9753 | .args(args) |
| 9754 | .current_dir(cwd) |
| 9755 | .stderr(Stdio::inherit()) |
| 9756 | .output() |
| 9757 | .map_err(|err| anyhow!("failed to spawn {command}: {err}"))?; |
| 9758 | if !output.status.success() { |
| 9759 | bail!("{command} {} failed with {}", args.join(" "), output.status); |
| 9760 | } |
| 9761 | String::from_utf8(output.stdout).context("command output was not valid UTF-8") |
| 9762 | } |
| 9763 | |
| 9764 | fn now_micros() -> Result<u128> { |
| 9765 | Ok(SystemTime::now() |
no test coverage detected