mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-30 00:00:16 +02:00
wasm: use build script to detect wasm (#4865)
Co-authored-by: Taiki Endo <[email protected]>
This commit is contained in:
@@ -6,7 +6,7 @@ use rand::{rngs::StdRng, Rng};
|
||||
use tokio::time::{self, Duration, Instant, Sleep};
|
||||
use tokio_test::{assert_elapsed, assert_pending, assert_ready, assert_ready_eq, task};
|
||||
|
||||
#[cfg(not(target_os = "wasi"))]
|
||||
#[cfg(not(tokio_wasi))]
|
||||
use tokio_test::assert_err;
|
||||
|
||||
use std::{
|
||||
@@ -29,14 +29,14 @@ async fn pause_time_in_task() {
|
||||
t.await.unwrap();
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi doesn't support threads
|
||||
#[cfg(all(feature = "full", not(tokio_wasi)))] // Wasi doesn't support threads
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
|
||||
#[should_panic]
|
||||
async fn pause_time_in_main_threads() {
|
||||
tokio::time::pause();
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi doesn't support threads
|
||||
#[cfg(all(feature = "full", not(tokio_wasi)))] // Wasi doesn't support threads
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
|
||||
async fn pause_time_in_spawn_threads() {
|
||||
let t = tokio::spawn(async {
|
||||
|
||||
Reference in New Issue
Block a user