Skip to content

Commit 4c15c53

Browse files
authored
Merge pull request #1451 from asomers/warns
Fix some warnings, and reenble tests that were broken on Travis
2 parents a640568 + 221eac1 commit 4c15c53

File tree

5 files changed

+17
-16
lines changed

5 files changed

+17
-16
lines changed

test/sys/test_aio.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,7 @@ fn test_fsync_error() {
142142
}
143143

144144
#[test]
145-
#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)]
146-
// On Travis, aio_suspend hits an assertion within glibc. This is either a bug
147-
// in Travis's version of glibc or Linux. Either way, we must skip the test.
145+
// On Cirrus on Linux, this test fails due to a glibc bug.
148146
// https://github.com/nix-rust/nix/issues/1099
149147
#[cfg_attr(target_os = "linux", ignore)]
150148
// On Cirrus, aio_suspend is failing with EINVAL

test/sys/test_aio_drop.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
target_os = "macos",
1010
target_os = "freebsd",
1111
target_os = "netbsd")))]
12-
#[cfg_attr(target_env = "gnu", ignore = "Occasionally fails in Travis; glibc bug suspected")]
1312
fn test_drop() {
1413
use nix::sys::aio::*;
1514
use nix::sys::signal::*;

test/test_fcntl.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,15 @@ mod linux_android {
102102
/// resulting file is read and should contain the contents `bar`.
103103
/// The from_offset should be updated by the call to reflect
104104
/// the 3 bytes read (6).
105-
///
106-
/// FIXME: This test is disabled for linux based builds, because Travis
107-
/// Linux version is too old for `copy_file_range`.
108105
#[test]
109-
#[ignore]
106+
// QEMU does not support copy_file_range. Skip platforms that use QEMU in CI
107+
#[cfg_attr(all(target_os = "linux", any(
108+
target_arch = "aarch64",
109+
target_arch = "arm",
110+
target_arch = "mips",
111+
target_arch = "mips64",
112+
target_arch = "powerpc64"
113+
)), ignore)]
110114
fn test_copy_file_range() {
111115
const CONTENTS: &[u8] = b"foobarbaz";
112116

test/test_ptymaster_drop.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ mod t {
1212
/// race condition.
1313
#[test]
1414
#[should_panic(expected = "Closing an invalid file descriptor!")]
15-
// In Travis on i686-unknown-linux-musl, this test gets SIGABRT. I don't
16-
// know why. It doesn't happen on any other target, and it doesn't happen
17-
// on my PC.
18-
#[cfg_attr(all(target_env = "musl", target_arch = "x86"), ignore)]
1915
fn test_double_close() {
2016
let m = posix_openpt(OFlag::O_RDWR).unwrap();
2117
close(m.as_raw_fd()).unwrap();

test/test_unistd.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#[cfg(not(target_os = "redox"))]
22
use nix::fcntl::{self, open, readlink};
3-
use nix::fcntl::{fcntl, FcntlArg, FdFlag, OFlag};
3+
use nix::fcntl::OFlag;
44
use nix::unistd::*;
55
use nix::unistd::ForkResult::*;
66
#[cfg(not(target_os = "redox"))]
@@ -13,14 +13,14 @@ use nix::errno::Errno;
1313
#[cfg(not(target_os = "redox"))]
1414
use nix::Error;
1515
use std::{env, iter};
16-
#[cfg(not(target_os = "redox"))]
16+
#[cfg(not(any(target_os = "fuchsia", target_os = "redox")))]
1717
use std::ffi::CString;
1818
#[cfg(not(target_os = "redox"))]
1919
use std::fs::DirBuilder;
2020
use std::fs::{self, File};
2121
use std::io::Write;
2222
use std::os::unix::prelude::*;
23-
#[cfg(not(target_os = "redox"))]
23+
#[cfg(not(any(target_os = "fuchsia", target_os = "redox")))]
2424
use std::path::Path;
2525
use tempfile::{tempdir, tempfile};
2626
use libc::{_exit, mode_t, off_t};
@@ -135,6 +135,8 @@ fn test_mkfifoat_none() {
135135
target_os = "macos", target_os = "ios",
136136
target_os = "android", target_os = "redox")))]
137137
fn test_mkfifoat() {
138+
use nix::fcntl;
139+
138140
let tempdir = tempdir().unwrap();
139141
let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap();
140142
let mkfifoat_name = "mkfifoat_name";
@@ -258,7 +260,7 @@ fn test_initgroups() {
258260
setgroups(&old_groups).unwrap();
259261
}
260262

261-
#[cfg(not(target_os = "redox"))]
263+
#[cfg(not(any(target_os = "fuchsia", target_os = "redox")))]
262264
macro_rules! execve_test_factory(
263265
($test_name:ident, $syscall:ident, $exe: expr $(, $pathname:expr, $flags:expr)*) => (
264266

@@ -669,6 +671,8 @@ fn test_pipe() {
669671
target_os = "solaris"))]
670672
#[test]
671673
fn test_pipe2() {
674+
use nix::fcntl::{fcntl, FcntlArg, FdFlag};
675+
672676
let (fd0, fd1) = pipe2(OFlag::O_CLOEXEC).unwrap();
673677
let f0 = FdFlag::from_bits_truncate(fcntl(fd0, FcntlArg::F_GETFD).unwrap());
674678
assert!(f0.contains(FdFlag::FD_CLOEXEC));

0 commit comments

Comments
 (0)