about summary refs log tree commit diff
path: root/library/test/src/console.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/test/src/console.rs')
-rw-r--r--library/test/src/console.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/library/test/src/console.rs b/library/test/src/console.rs
index 09aa3bfb6aa..8096e498263 100644
--- a/library/test/src/console.rs
+++ b/library/test/src/console.rs
@@ -323,10 +323,11 @@ pub fn run_tests_console(opts: &TestOpts, tests: Vec<TestDescAndFn>) -> io::Resu
     // Prevent the usage of `Instant` in some cases:
     // - It's currently not supported for wasm targets.
     // - We disable it for miri because it's not available when isolation is enabled.
-    let is_instant_supported =
-        !cfg!(target_family = "wasm") && !cfg!(target_os = "zkvm") && !cfg!(miri);
+    let is_instant_unsupported = (cfg!(target_family = "wasm") && !cfg!(target_os = "wasi"))
+        || cfg!(target_os = "zkvm")
+        || cfg!(miri);
 
-    let start_time = is_instant_supported.then(Instant::now);
+    let start_time = (!is_instant_unsupported).then(Instant::now);
     run_tests(opts, tests, |x| on_test_event(&x, &mut st, &mut *out))?;
     st.exec_time = start_time.map(|t| TestSuiteExecTime(t.elapsed()));