From 2db97299801d6c479cdb1f8fe8c214171e3c530f Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 30 Oct 2023 06:25:26 -0700 Subject: [PATCH] Don't test `test_boottime_alarm_clock` on platforms that don't have it. --- src/clockid.rs | 4 +++- tests/time/clocks.rs | 7 +------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/clockid.rs b/src/clockid.rs index 19b464399..480db6a61 100644 --- a/src/clockid.rs +++ b/src/clockid.rs @@ -66,8 +66,10 @@ pub enum ClockId { Tai = bitcast!(c::CLOCK_TAI), /// `CLOCK_BOOTTIME`, available on Linux >= 2.6.39 + /// + /// On FreeBSD, use [`Self::Uptime`], as `CLOCK_BOOTTIME` is an alias for + /// `CLOCK_UPTIME`. #[cfg(any( - freebsdlike, all(linux_kernel, feature = "linux_4_11"), target_os = "fuchsia", target_os = "openbsd" diff --git a/tests/time/clocks.rs b/tests/time/clocks.rs index 526a35b38..9d4adc0d4 100644 --- a/tests/time/clocks.rs +++ b/tests/time/clocks.rs @@ -58,12 +58,7 @@ fn test_boottime_clock() { /// Attempt to test that the boot alarm clock is monotonic. Time may or may not /// advance, but it shouldn't regress. -#[cfg(any( - freebsdlike, - linux_kernel, - target_os = "fuchsia", - target_os = "openbsd" -))] +#[cfg(any(linux_kernel, target_os = "fuchsia"))] #[test] fn test_boottime_alarm_clock() { use rustix::time::{clock_gettime_dynamic, DynamicClockId};