test std::time APIs on FreeBSD and Solarish

This commit is contained in:
Ralf Jung 2024-09-15 12:37:48 +02:00
parent 8ee38bf230
commit f394c6ce8c
3 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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.)")
}

View File

@ -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.)