about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-09-15 12:37:48 +0200
committerRalf Jung <post@ralfj.de>2024-09-15 12:45:30 +0200
commitf394c6ce8c1b155df686597c2cee9ecd7eb8f7ce (patch)
tree84f9f5baa299f6da1fd27a487e250632bb5003f5
parent8ee38bf2303f9aa72e4c957e11a6974fe0c3af6c (diff)
downloadrust-f394c6ce8c1b155df686597c2cee9ecd7eb8f7ce.tar.gz
rust-f394c6ce8c1b155df686597c2cee9ecd7eb8f7ce.zip
test std::time APIs on FreeBSD and Solarish
-rwxr-xr-xsrc/tools/miri/ci/ci.sh8
-rw-r--r--src/tools/miri/tests/pass/shims/time-with-isolation.rs4
-rw-r--r--src/tools/miri/tests/pass/shims/time-with-isolation.stdout2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/tools/miri/ci/ci.sh b/src/tools/miri/ci/ci.sh
index 1d72f42d5c7..ee8e8d3e1c8 100755
--- a/src/tools/miri/ci/ci.sh
+++ b/src/tools/miri/ci/ci.sh
@@ -150,10 +150,10 @@ case $HOST_TARGET in
     # Partially supported targets (tier 2)
     BASIC="empty_main integer vec string btreemap hello hashmap heap_alloc align" # ensures we have the basics: stdout/stderr, system allocator, randomness (for HashMap initialization)
     UNIX="panic/panic panic/unwind concurrency/simple atomic libc-mem libc-misc libc-random env num_cpus" # the things that are very similar across all Unixes, and hence easily supported there
-    TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal $BASIC $UNIX threadname pthread libc-time fs
-    TEST_TARGET=i686-unknown-freebsd   run_tests_minimal $BASIC $UNIX threadname pthread libc-time fs
-    TEST_TARGET=x86_64-unknown-illumos run_tests_minimal $BASIC $UNIX threadname pthread sync available-parallelism libc-time tls
-    TEST_TARGET=x86_64-pc-solaris      run_tests_minimal $BASIC $UNIX threadname pthread sync available-parallelism libc-time tls
+    TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal $BASIC $UNIX threadname pthread time fs
+    TEST_TARGET=i686-unknown-freebsd   run_tests_minimal $BASIC $UNIX threadname pthread time fs
+    TEST_TARGET=x86_64-unknown-illumos run_tests_minimal $BASIC $UNIX threadname pthread sync available-parallelism time tls
+    TEST_TARGET=x86_64-pc-solaris      run_tests_minimal $BASIC $UNIX threadname pthread sync available-parallelism time tls
     TEST_TARGET=aarch64-linux-android  run_tests_minimal $BASIC $UNIX pthread --skip threadname --skip pthread_cond_timedwait
     TEST_TARGET=wasm32-wasip2          run_tests_minimal empty_main wasm heap_alloc libc-mem
     TEST_TARGET=wasm32-unknown-unknown run_tests_minimal empty_main wasm
diff --git a/src/tools/miri/tests/pass/shims/time-with-isolation.rs b/src/tools/miri/tests/pass/shims/time-with-isolation.rs
index 645d42ad975..e7b16244123 100644
--- a/src/tools/miri/tests/pass/shims/time-with-isolation.rs
+++ b/src/tools/miri/tests/pass/shims/time-with-isolation.rs
@@ -41,9 +41,9 @@ fn test_block_for_one_second() {
 /// Ensures that we get the same behavior across all targets.
 fn test_deterministic() {
     let begin = Instant::now();
-    for _ in 0..100_000 {}
+    for _ in 0..10_000 {}
     let time = begin.elapsed();
-    println!("The loop took around {}s", time.as_secs());
+    println!("The loop took around {}ms", time.as_millis());
     println!("(It's fine for this number to change when you `--bless` this test.)")
 }
 
diff --git a/src/tools/miri/tests/pass/shims/time-with-isolation.stdout b/src/tools/miri/tests/pass/shims/time-with-isolation.stdout
index ff5889bacd5..2d7fb5f4a61 100644
--- a/src/tools/miri/tests/pass/shims/time-with-isolation.stdout
+++ b/src/tools/miri/tests/pass/shims/time-with-isolation.stdout
@@ -1,2 +1,2 @@
-The loop took around 12s
+The loop took around 1250ms
 (It's fine for this number to change when you `--bless` this test.)