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

Function run_threads

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

Source from the content-addressed store, hash-verified

554#[cfg(feature = "wasi-threads")]
555#[test]
556fn run_threads() -> Result<()> {
557 // Only run threaded tests on platforms that support threads. Also skip
558 // these tests with ASAN as it, rightfully, complains about a memory leak.
559 // The memory leak at this time is that child threads aren't joined with the
560 // main thread, meaning that allocations done on child threads are indeed
561 // leaked.
562 if crate::threads::engine().is_none() || cfg!(asan) {
563 return Ok(());
564 }
565 let wasm = build_wasm("tests/all/cli_tests/threads.wat")?;
566 let stdout = run_wasmtime(&[
567 "run",
568 "-Wthreads,shared-memory",
569 "-Sthreads",
570 "-Ccache=n",
571 wasm.path().to_str().unwrap(),
572 ])?;
573
574 assert!(
575 stdout
576 == "Called _start\n\
577 Running wasi_thread_start\n\
578 Running wasi_thread_start\n\
579 Running wasi_thread_start\n\
580 Done\n"
581 );
582 Ok(())
583}
584
585#[cfg(feature = "wasi-threads")]
586#[test]

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