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

Function exit126_wasi_snapshot0

tests/all/cli_tests.rs:288–301  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

286// Exit with an invalid non-zero exit code, snapshot0 edition.
287#[test]
288fn exit126_wasi_snapshot0() -> Result<()> {
289 let wasm = build_wasm("tests/all/cli_tests/exit126_wasi_snapshot0.wat")?;
290
291 for preview2 in ["-Spreview2=n", "-Spreview2=y"] {
292 let output = run_wasmtime_for_output(
293 &["-Ccache=n", preview2, wasm.path().to_str().unwrap()],
294 None,
295 )?;
296 assert_eq!(output.status.code().unwrap(), 1);
297 assert!(output.stdout.is_empty());
298 assert!(String::from_utf8_lossy(&output.stderr).contains("invalid exit status"));
299 }
300 Ok(())
301}
302
303// Exit with an invalid non-zero exit code, snapshot1 edition.
304#[test]

Callers

nothing calls this directly

Calls 6

run_wasmtime_for_outputFunction · 0.85
OkFunction · 0.85
to_strMethod · 0.80
build_wasmFunction · 0.70
unwrapMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected