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

Function run_simple_with_wasi_threads

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

Source from the content-addressed store, hash-verified

585#[cfg(feature = "wasi-threads")]
586#[test]
587fn run_simple_with_wasi_threads() -> Result<()> {
588 // Skip this test on platforms that don't support threads.
589 if crate::threads::engine().is_none() {
590 return Ok(());
591 }
592 // We expect to be able to run Wasm modules that do not have correct
593 // wasi-thread entry points or imported shared memory as long as no threads
594 // are spawned.
595 let wasm = build_wasm("tests/all/cli_tests/simple.wat")?;
596 let stdout = run_wasmtime(&[
597 "run",
598 "-Wthreads",
599 "-Sthreads",
600 "-Ccache=n",
601 "--invoke",
602 "simple",
603 wasm.path().to_str().unwrap(),
604 "4",
605 ])?;
606 assert_eq!(stdout, "4\n");
607 Ok(())
608}
609
610#[test]
611fn wasm_flags() -> Result<()> {

Callers

nothing calls this directly

Calls 8

OkFunction · 0.85
run_wasmtimeFunction · 0.85
to_strMethod · 0.80
engineFunction · 0.70
build_wasmFunction · 0.70
is_noneMethod · 0.45
unwrapMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected