Run the wasmtime CLI with the provided args and, if it succeeds, return the standard output in a `String`.
(args: &[&str])
| 36 | // Run the wasmtime CLI with the provided args and, if it succeeds, return |
| 37 | // the standard output in a `String`. |
| 38 | pub fn run_wasmtime(args: &[&str]) -> Result<String> { |
| 39 | let output = run_wasmtime_for_output(args, None)?; |
| 40 | if !output.status.success() { |
| 41 | bail!( |
| 42 | "Failed to execute wasmtime with: {:?}\nstatus: {}\n{}", |
| 43 | args, |
| 44 | output.status, |
| 45 | String::from_utf8_lossy(&output.stderr) |
| 46 | ); |
| 47 | } |
| 48 | Ok(String::from_utf8(output.stdout).unwrap()) |
| 49 | } |
| 50 | |
| 51 | fn build_wasm(wat_path: impl AsRef<Path>) -> Result<NamedTempFile> { |
| 52 | let mut wasm_file = NamedTempFile::new()?; |
no test coverage detected