Skip to content

Commit 0d5ff87

Browse files
committed
pgrep: make two tests linux-only
1 parent 96b72ae commit 0d5ff87

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/uu/pgrep/src/process.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ pub fn walk_process() -> impl Iterator<Item = ProcessInformation> {
381381
#[cfg(test)]
382382
mod tests {
383383
use super::*;
384+
#[cfg(target_os = "linux")]
384385
use std::{collections::HashSet, str::FromStr};
385386

386387
#[test]
@@ -398,6 +399,7 @@ mod tests {
398399
assert!(RunState::try_from("Rg").is_err());
399400
}
400401

402+
#[cfg(target_os = "linux")]
401403
fn current_pid() -> usize {
402404
// Direct read link of /proc/self.
403405
// It's result must be current programs pid.
@@ -410,6 +412,7 @@ mod tests {
410412
}
411413

412414
#[test]
415+
#[cfg(target_os = "linux")]
413416
fn test_walk_pid() {
414417
let current_pid = current_pid();
415418

@@ -419,6 +422,7 @@ mod tests {
419422
}
420423

421424
#[test]
425+
#[cfg(target_os = "linux")]
422426
fn test_pid_entry() {
423427
let current_pid = current_pid();
424428

0 commit comments

Comments
 (0)