Skip to content

Commit

Permalink
Merge branch 'nix-rust:master' into issue1733-make-F_SEAL-available-o…
Browse files Browse the repository at this point in the history
…n-FreeBSD
  • Loading branch information
SteveLauC authored Aug 12, 2022
2 parents e2b9624 + d96436e commit 22faed4
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
8 changes: 7 additions & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ env:
# The MSRV
TOOLCHAIN: 1.46.0
ZFLAGS:
# Temporarily disable cargo-hack until we raise the MSRV to 1.51.0 or later.
# See https://github.com/nix-rust/nix/pull/1792
NOHACK: 1

# Tests that don't require executing the build binaries
build: &BUILD
Expand Down Expand Up @@ -64,7 +67,7 @@ task:
- cargo test --target i686-unknown-freebsd
i386_feature_script:
- . $HOME/.cargo/env
- cargo hack check --each-feature --target i686-unknown-freebsd
- if [ -z "$NOHACK" ]; then cargo hack check --each-feature --target i686-unknown-freebsd; fi
before_cache_script: rm -rf $CARGO_HOME/registry/index

# Test macOS x86_64 in a full VM
Expand Down Expand Up @@ -92,6 +95,9 @@ task:
PATH: $HOME/.cargo/bin:$PATH
RUSTFLAGS: --cfg qemu -D warnings
TOOL: cross
# Cross needs at least 1.51.0 after Serde accidentally raised its MSRV.
# And Clippy has too many false positives from 1.51.0 through 1.53.0
TOOLCHAIN: 1.54.0
matrix:
- name: Linux arm gnueabi
env:
Expand Down
9 changes: 4 additions & 5 deletions src/sys/signalfd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,17 @@ mod tests {
#[test]
fn create_signalfd() {
let mask = SigSet::empty();
let fd = SignalFd::new(&mask);
fd.expect("assert failed");
SignalFd::new(&mask).unwrap();
}

#[test]
fn create_signalfd_with_opts() {
let mask = SigSet::empty();
let fd = SignalFd::with_flags(
SignalFd::with_flags(
&mask,
SfdFlags::SFD_CLOEXEC | SfdFlags::SFD_NONBLOCK,
);
fd.expect("assert failed");
)
.unwrap();
}

#[test]
Expand Down
12 changes: 4 additions & 8 deletions test/sys/test_aio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ mod aio_fsync {
0,
SigevNotify::SigevNone,
));
let err = aiof.as_mut().submit();
err.expect("assert failed");
aiof.as_mut().submit().unwrap();
poll_aio!(&mut aiof).unwrap();
aiof.as_mut().aio_return().unwrap();
}
Expand Down Expand Up @@ -148,8 +147,7 @@ mod aio_read {
Box::pin(AioRead::new(fd, 2, &mut rbuf, 0, SigevNotify::SigevNone));
aior.as_mut().submit().unwrap();

let cancelstat = aior.as_mut().cancel();
cancelstat.expect("assert failed");
aior.as_mut().cancel().unwrap();

// Wait for aiow to complete, but don't care whether it succeeded
let _ = poll_aio!(&mut aior);
Expand Down Expand Up @@ -341,8 +339,7 @@ mod aio_write {
let err = aiow.as_mut().error();
assert!(err == Ok(()) || err == Err(Errno::EINPROGRESS));

let cancelstat = aiow.as_mut().cancel();
cancelstat.expect("assert failed");
aiow.as_mut().cancel().unwrap();

// Wait for aiow to complete, but don't care whether it succeeded
let _ = poll_aio!(&mut aiow);
Expand Down Expand Up @@ -564,8 +561,7 @@ fn test_aio_cancel_all() {
let err = aiocb.as_mut().error();
assert!(err == Ok(()) || err == Err(Errno::EINPROGRESS));

let cancelstat = aio_cancel_all(f.as_raw_fd());
cancelstat.expect("assert failed");
aio_cancel_all(f.as_raw_fd()).unwrap();

// Wait for aiocb to complete, but don't care whether it succeeded
let _ = poll_aio!(&mut aiocb);
Expand Down
2 changes: 1 addition & 1 deletion test/sys/test_termios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fn test_tcgetattr_pty() {
let _m = crate::PTSNAME_MTX.lock();

let pty = openpty(None, None).expect("openpty failed");
termios::tcgetattr(pty.slave).expect("assert failed");
termios::tcgetattr(pty.slave).unwrap();
close(pty.master).expect("closing the master failed");
close(pty.slave).expect("closing the slave failed");
}
Expand Down
10 changes: 5 additions & 5 deletions test/test_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ pub fn test_clock_gettime() {
#[test]
pub fn test_clock_getcpuclockid() {
let clock_id = clock_getcpuclockid(nix::unistd::Pid::this()).unwrap();
clock_gettime(clock_id).expect("assert failed");
clock_gettime(clock_id).unwrap();
}

#[cfg(not(target_os = "redox"))]
#[test]
pub fn test_clock_id_res() {
ClockId::CLOCK_REALTIME.res().expect("assert failed");
ClockId::CLOCK_REALTIME.res().unwrap();
}

#[test]
pub fn test_clock_id_now() {
ClockId::CLOCK_REALTIME.now().expect("assert failed");
ClockId::CLOCK_REALTIME.now().unwrap();
}

#[cfg(any(
Expand All @@ -54,6 +54,6 @@ pub fn test_clock_id_now() {
pub fn test_clock_id_pid_cpu_clock_id() {
ClockId::pid_cpu_clock_id(nix::unistd::Pid::this())
.map(ClockId::now)
.expect("assert failed")
.expect("assert failed");
.unwrap()
.unwrap();
}

0 comments on commit 22faed4

Please sign in to comment.