summaryrefslogtreecommitdiff
path: root/test/test_ptymaster_drop.rs
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_ptymaster_drop.rs')
-rw-r--r--test/test_ptymaster_drop.rs39
1 files changed, 22 insertions, 17 deletions
diff --git a/test/test_ptymaster_drop.rs b/test/test_ptymaster_drop.rs
index e5da9183..5a5c55d4 100644
--- a/test/test_ptymaster_drop.rs
+++ b/test/test_ptymaster_drop.rs
@@ -1,19 +1,24 @@
-use nix::fcntl::OFlag;
-use nix::pty::*;
-use nix::unistd::close;
-use std::os::unix::io::AsRawFd;
+#[cfg(not(target_os = "redox"))]
+mod t {
+ use nix::fcntl::OFlag;
+ use nix::pty::*;
+ use nix::unistd::close;
+ use std::os::unix::io::AsRawFd;
-/// Regression test for Issue #659
-/// `PtyMaster` should panic rather than double close the file descriptor
-/// This must run in its own test process because it deliberately creates a race
-/// condition.
-#[test]
-#[should_panic(expected = "Closing an invalid file descriptor!")]
-// In Travis on i686-unknown-linux-musl, this test gets SIGABRT. I don't know
-// why. It doesn't happen on any other target, and it doesn't happen on my PC.
-#[cfg_attr(all(target_env = "musl", target_arch = "x86"), ignore)]
-fn test_double_close() {
- let m = posix_openpt(OFlag::O_RDWR).unwrap();
- close(m.as_raw_fd()).unwrap();
- drop(m); // should panic here
+ /// Regression test for Issue #659
+ ///
+ /// `PtyMaster` should panic rather than double close the file descriptor
+ /// This must run in its own test process because it deliberately creates a
+ /// race condition.
+ #[test]
+ #[should_panic(expected = "Closing an invalid file descriptor!")]
+ // In Travis on i686-unknown-linux-musl, this test gets SIGABRT. I don't
+ // know why. It doesn't happen on any other target, and it doesn't happen
+ // on my PC.
+ #[cfg_attr(all(target_env = "musl", target_arch = "x86"), ignore)]
+ fn test_double_close() {
+ let m = posix_openpt(OFlag::O_RDWR).unwrap();
+ close(m.as_raw_fd()).unwrap();
+ drop(m); // should panic here
+ }
}