From ac0750628879719b216e04f9248df8f5a5d10b4b Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Tue, 20 Oct 2015 14:53:46 -0700 Subject: Only run signalfd tests when feature is set --- test/sys/mod.rs | 2 +- test/sys/test_uio.rs | 4 ++-- 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() {} -- cgit v1.2.3