Skip to content

Commit

Permalink
Don't test test_boottime_alarm_clock on platforms that don't have it.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfishcode committed Oct 30, 2023
1 parent 3f4f369 commit 2db9729
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/clockid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 1 addition & 6 deletions tests/time/clocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down

0 comments on commit 2db9729

Please sign in to comment.