Skip to content

Commit

Permalink
Move test_aio_drop from Cargo.toml to test mod.rs
Browse files Browse the repository at this point in the history
This makes it easier to add conditional compilation flags, the same
way it's done for test_aio.
  • Loading branch information
thendiscard committed Dec 21, 2018
1 parent 25fa7db commit b21598b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ sysctl = "0.1"
name = "test"
path = "test/test.rs"

[[test]]
name = "test-aio-drop"
path = "test/sys/test_aio_drop.rs"

[[test]]
name = "test-lio-listio-resubmit"
path = "test/sys/test_lio_listio_resubmit.rs"
Expand Down
6 changes: 6 additions & 0 deletions test/sys/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ mod test_signal;
target_os = "macos",
target_os = "netbsd"))]
mod test_aio;
#[cfg(any(target_os = "freebsd",
target_os = "ios",
target_os = "linux",
target_os = "macos",
target_os = "netbsd"))]
mod test_aio_drop;
#[cfg(target_os = "linux")]
mod test_signalfd;
mod test_socket;
Expand Down
4 changes: 1 addition & 3 deletions test/sys/test_aio_drop.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
extern crate nix;
extern crate tempfile;

#[cfg(not(target_os = "openbsd"))]
use nix::sys::aio::*;
use nix::sys::signal::*;
use std::os::unix::io::AsRawFd;
Expand All @@ -12,8 +11,7 @@ use tempfile::tempfile;
// the AIO subsystem and causes subsequent tests to fail
#[test]
#[should_panic(expected = "Dropped an in-progress AioCb")]
#[cfg(not(any(target_env = "musl",
target_os = "openbsd")))]
#[cfg(not(target_env = "musl"))]
fn test_drop() {
const WBUF: &[u8] = b"CDEF";

Expand Down

1 comment on commit b21598b

@asomers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this change. There was a reason I did it this way. As I explain in the comment, on OSX this test hoses the AIO subsystem for the whole process on OSX.

Please sign in to comment.