diff options
author | Carl Lerche <me@carllerche.com> | 2015-10-20 14:53:46 -0700 |
---|---|---|
committer | Carl Lerche <me@carllerche.com> | 2015-10-20 14:53:46 -0700 |
commit | ac0750628879719b216e04f9248df8f5a5d10b4b (patch) | |
tree | cc9f47f16632cbfc729cc1e46b4cfd5351b1d19c | |
parent | 2851a3549bf5593f221bd3653e3299f1486ef5a0 (diff) | |
download | nix-ac0750628879719b216e04f9248df8f5a5d10b4b.zip |
Only run signalfd tests when feature is set
-rw-r--r-- | test/sys/mod.rs | 2 | ||||
-rw-r--r-- | test/sys/test_uio.rs | 4 | ||||
-rw-r--r-- | test/test_signalfd.rs | 9 |
3 files changed, 7 insertions, 8 deletions
diff --git a/test/sys/mod.rs b/test/sys/mod.rs index fbb4a6e0..fd4e984d 100644 --- a/test/sys/mod.rs +++ b/test/sys/mod.rs @@ -1,6 +1,6 @@ mod test_socket; mod test_termios; -mod test_uio; mod test_ioctl; mod test_wait; mod test_select; +mod test_uio; diff --git a/test/sys/test_uio.rs b/test/sys/test_uio.rs index 4261b5de..fdf49bf5 100644 --- a/test/sys/test_uio.rs +++ b/test/sys/test_uio.rs @@ -130,7 +130,7 @@ fn test_pread() { } #[test] -#[cfg(target_os = "linux")] +#[cfg(feature = "preadv_pwritev")] fn test_pwritev() { use std::io::Read; @@ -160,7 +160,7 @@ fn test_pwritev() { } #[test] -#[cfg(target_os = "linux")] +#[cfg(feature = "preadv_pwritev")] fn test_preadv() { use std::io::Write; diff --git a/test/test_signalfd.rs b/test/test_signalfd.rs index 2ca5b61c..fb28e2ad 100644 --- a/test/test_signalfd.rs +++ b/test/test_signalfd.rs @@ -1,13 +1,12 @@ -#![cfg(feature = "signalfd")] - extern crate nix; use nix::unistd; -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(feature = "signalfd")] + use nix::sys::signalfd::*; -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(feature = "signalfd")] fn main() { let mut mask = SigSet::empty(); mask.add(signal::SIGUSR1).unwrap(); @@ -28,5 +27,5 @@ fn main() { assert_eq!(info.ssi_signo as i32, signal::SIGUSR1); } -#[cfg(not(any(target_os = "linux", target_os = "android")))] +#[cfg(not(feature = "signalfd"))] fn main() {} |