wasm: use build script to detect wasm (#4865)

Co-authored-by: Taiki Endo <[email protected]>
This commit is contained in:
Alice Ryhl
2022-07-26 11:26:54 +00:00
committed by GitHub
co-authored by Taiki Endo
parent 0dc62da21b
commit b2ada60e70
91 changed files with 222 additions and 195 deletions
+3 -3
View File
@@ -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 {