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

Function wizen

tests/all/cli_tests.rs:3384–3403  ·  view source on GitHub ↗
(args: &[&str], wat: &str)

Source from the content-addressed store, hash-verified

3382}
3383
3384fn wizen(args: &[&str], wat: &str) -> Result<Output> {
3385 let mut cmd = get_wasmtime_command()?;
3386 cmd.arg("wizer").args(args).arg("-");
3387 cmd.stdin(Stdio::piped())
3388 .stdout(Stdio::piped())
3389 .stderr(Stdio::piped());
3390 let mut child = cmd.spawn()?;
3391 let mut stdin = child.stdin.take().unwrap();
3392 stdin.write_all(wat.as_bytes())?;
3393 drop(stdin);
3394
3395 let output = child.wait_with_output()?;
3396 if !output.status.success() {
3397 println!(
3398 "Failed to execute wasmtime wizer with: {cmd:?}\n{}",
3399 String::from_utf8_lossy(&output.stderr)
3400 );
3401 }
3402 Ok(output)
3403}
3404
3405#[test]
3406fn wizer_no_imports_by_default() -> Result<()> {

Callers 2

wizer_componentsFunction · 0.70

Calls 14

get_wasmtime_commandFunction · 0.85
OkFunction · 0.85
write_allMethod · 0.80
as_bytesMethod · 0.80
dropFunction · 0.50
argMethod · 0.45
argsMethod · 0.45
stderrMethod · 0.45
stdoutMethod · 0.45
stdinMethod · 0.45
spawnMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected