From 96b72ae03864f1fbf8c32276e9e5734c8d696802 Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Sun, 3 Nov 2024 14:37:33 +0100 Subject: [PATCH] w: make test module linux-only --- src/uu/w/src/w.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/uu/w/src/w.rs b/src/uu/w/src/w.rs index 5f96500..6ba4d55 100644 --- a/src/uu/w/src/w.rs +++ b/src/uu/w/src/w.rs @@ -257,6 +257,7 @@ pub fn uu_app() -> Command { } #[cfg(test)] +#[cfg(target_os = "linux")] mod tests { use crate::{ fetch_cmdline, fetch_pcpu_time, fetch_terminal_number, format_time, get_clock_tick, @@ -264,7 +265,6 @@ mod tests { use std::{fs, path::Path, process}; #[test] - #[cfg(target_os = "linux")] fn test_format_time() { let unix_epoc = chrono::Local::now() .format("%Y-%m-%d %H:%M:%S%.6f %::z") @@ -284,7 +284,6 @@ mod tests { } #[test] - #[cfg(target_os = "linux")] // Get PID of current process and use that for cmdline testing fn test_fetch_cmdline() { // uucore's utmpx returns an i32, so we cast to that to mimic it. @@ -297,7 +296,6 @@ mod tests { } #[test] - #[cfg(target_os = "linux")] fn test_fetch_terminal_number() { let pid = process::id() as i32; let path = Path::new("/proc").join(pid.to_string()).join("stat"); @@ -308,7 +306,6 @@ mod tests { } #[test] - #[cfg(target_os = "linux")] fn test_fetch_pcpu_time() { let pid = process::id() as i32; let path = Path::new("/proc").join(pid.to_string()).join("stat");