()
| 554 | #[cfg(feature = "wasi-threads")] |
| 555 | #[test] |
| 556 | fn 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] |
nothing calls this directly
no test coverage detected