Skip to content

Commit

Permalink
w: make test module linux-only
Browse files Browse the repository at this point in the history
  • Loading branch information
cakebaker committed Nov 12, 2024
1 parent 2c4a5dd commit 96b72ae
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/uu/w/src/w.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,14 @@ 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,
};
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")
Expand All @@ -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.
Expand All @@ -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");
Expand All @@ -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");
Expand Down

0 comments on commit 96b72ae

Please sign in to comment.