Run the wasmtime CLI with the provided args and return the `Output`. If the `stdin` is `Some`, opens the file and redirects to the child's stdin.
(args: &[&str], stdin: Option<&Path>)
| 10 | // Run the wasmtime CLI with the provided args and return the `Output`. |
| 11 | // If the `stdin` is `Some`, opens the file and redirects to the child's stdin. |
| 12 | pub fn run_wasmtime_for_output(args: &[&str], stdin: Option<&Path>) -> Result<Output> { |
| 13 | let mut cmd = get_wasmtime_command()?; |
| 14 | cmd.args(args); |
| 15 | if let Some(file) = stdin { |
| 16 | cmd.stdin(File::open(file)?); |
| 17 | } |
| 18 | cmd.output().map_err(Into::into) |
| 19 | } |
| 20 | |
| 21 | /// Get the Wasmtime CLI as a [Command]. |
| 22 | pub fn get_wasmtime_command() -> Result<Command> { |
no test coverage detected