From 510720e9fcb1181cc2e634fe6edddadf2d2c4993 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 6 Apr 2024 14:43:39 +0200 Subject: [PATCH] libtest: also measure time in Miri --- library/test/src/console.rs | 6 ++---- src/bootstrap/src/utils/render_tests.rs | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/library/test/src/console.rs b/library/test/src/console.rs index f3918ba333a..7e224d60d9d 100644 --- a/library/test/src/console.rs +++ b/library/test/src/console.rs @@ -315,10 +315,8 @@ pub fn run_tests_console(opts: &TestOpts, tests: Vec) -> 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_unsupported = (cfg!(target_family = "wasm") && !cfg!(target_os = "wasi")) - || cfg!(target_os = "zkvm") - || cfg!(miri); + let is_instant_unsupported = + (cfg!(target_family = "wasm") && !cfg!(target_os = "wasi")) || cfg!(target_os = "zkvm"); let start_time = (!is_instant_unsupported).then(Instant::now); run_tests(opts, tests, |x| on_test_event(&x, &mut st, &mut *out))?; diff --git a/src/bootstrap/src/utils/render_tests.rs b/src/bootstrap/src/utils/render_tests.rs index 95cd55c9a3d..16e0c2ac185 100644 --- a/src/bootstrap/src/utils/render_tests.rs +++ b/src/bootstrap/src/utils/render_tests.rs @@ -377,7 +377,7 @@ struct SuiteOutcome { measured: usize, filtered_out: usize, /// The time it took to execute this test suite, or `None` if time measurement was not possible - /// (e.g. due to running inside Miri). + /// (e.g. due to running on wasm). exec_time: Option, }