MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / run_wasmtime_for_output

Function run_wasmtime_for_output

tests/all/cli_tests.rs:12–19  ·  view source on GitHub ↗

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>)

Source from the content-addressed store, hash-verified

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.
12pub 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].
22pub fn get_wasmtime_command() -> Result<Command> {

Callers 15

run_wasmtimeFunction · 0.85
timeout_in_startFunction · 0.85
timeout_in_invokeFunction · 0.85
exit2_wasi_snapshot0Function · 0.85
exit2_wasi_snapshot1Function · 0.85
exit125_wasi_snapshot0Function · 0.85
exit125_wasi_snapshot1Function · 0.85
exit126_wasi_snapshot0Function · 0.85
exit126_wasi_snapshot1Function · 0.85
exit_with_saved_fprsFunction · 0.85

Calls 4

get_wasmtime_commandFunction · 0.85
outputMethod · 0.80
argsMethod · 0.45
stdinMethod · 0.45

Tested by

no test coverage detected