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

Function run_wasmtime

tests/all/cli_tests.rs:38–49  ·  view source on GitHub ↗

Run the wasmtime CLI with the provided args and, if it succeeds, return the standard output in a `String`.

(args: &[&str])

Source from the content-addressed store, hash-verified

36// Run the wasmtime CLI with the provided args and, if it succeeds, return
37// the standard output in a `String`.
38pub 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
51fn build_wasm(wat_path: impl AsRef<Path>) -> Result<NamedTempFile> {
52 let mut wasm_file = NamedTempFile::new()?;

Callers 15

run_wasmtime_simpleFunction · 0.85
run_coredump_smoketestFunction · 0.85
run_wasmtime_simple_watFunction · 0.85
hello_wasi_snapshot0Function · 0.85
hello_wasi_snapshot1Function · 0.85
minimal_commandFunction · 0.85
minimal_reactorFunction · 0.85
command_invokeFunction · 0.85
reactor_invokeFunction · 0.85
greeterFunction · 0.85
greeter_preload_commandFunction · 0.85

Calls 4

run_wasmtime_for_outputFunction · 0.85
OkFunction · 0.85
successMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected