Skip to content

Commit 0c21a2e

Browse files
committed
Test on both FreeBSD 12 and 14
By default only enable tests that will pass on FreeBSD 12.3. But run a CI job on FreeBSD 14 and set a flag that will enable such tests.
1 parent 97b1a72 commit 0c21a2e

File tree

5 files changed

+22
-10
lines changed

5 files changed

+22
-10
lines changed

.cirrus.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,18 @@ test: &TEST
3434
# 64-bit kernel and in a 64-bit environment. Our tests don't execute any of
3535
# the system's binaries, so the environment shouldn't matter.
3636
task:
37-
name: FreeBSD amd64 & i686
3837
env:
3938
TARGET: x86_64-unknown-freebsd
40-
freebsd_instance:
41-
image: freebsd-12-3-release-amd64
39+
matrix:
40+
- name: FreeBSD 12 amd64 & i686
41+
freebsd_instance:
42+
image: freebsd-12-3-release-amd64
43+
- name: FreeBSD 14 amd64 & i686
44+
freebsd_instance:
45+
image_family: freebsd-14-0-snap
46+
# Enable tests that would fail on FreeBSD 12
47+
RUSTFLAGS: --cfg fbsd14 -D warnings
48+
RUSTDOCFLAGS: --cfg fbsd14
4249
setup_script:
4350
- kldload mqueuefs
4451
- fetch https://sh.rustup.rs -o rustup.sh

bors.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ status = [
55
"Android i686",
66
"Android x86_64",
77
"DragonFly BSD x86_64",
8-
"FreeBSD amd64 & i686",
8+
"FreeBSD 12 amd64 & i686",
9+
"FreeBSD 14 amd64 & i686",
910
"Fuchsia x86_64",
1011
"Linux MIPS",
1112
"Linux MIPS64 el",

src/fcntl.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -742,8 +742,8 @@ impl SpacectlRange {
742742
///
743743
/// # Example
744744
///
745-
// no_run because it fails to link until FreeBSD 14.0
746-
/// ```no_run
745+
#[cfg_attr(fbsd14, doc = " ```")]
746+
#[cfg_attr(not(fbsd14), doc = " ```no_run")]
747747
/// # use std::io::Write;
748748
/// # use std::os::unix::fs::FileExt;
749749
/// # use std::os::unix::io::AsRawFd;
@@ -788,8 +788,8 @@ pub fn fspacectl(fd: RawFd, range: SpacectlRange) -> Result<SpacectlRange> {
788788
///
789789
/// # Example
790790
///
791-
// no_run because it fails to link until FreeBSD 14.0
792-
/// ```no_run
791+
#[cfg_attr(fbsd14, doc = " ```")]
792+
#[cfg_attr(not(fbsd14), doc = " ```no_run")]
793793
/// # use std::io::Write;
794794
/// # use std::os::unix::fs::FileExt;
795795
/// # use std::os::unix::io::AsRawFd;

src/sys/aio.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,8 @@ impl<'a> AsRef<libc::aiocb> for AioRead<'a> {
619619
/// # Examples
620620
///
621621
///
622-
/// ```
622+
#[cfg_attr(fbsd14, doc = " ```")]
623+
#[cfg_attr(not(fbsd14), doc = " ```no_run")]
623624
/// # use nix::errno::Errno;
624625
/// # use nix::Error;
625626
/// # use nix::sys::aio::*;
@@ -845,7 +846,8 @@ impl<'a> AsRef<libc::aiocb> for AioWrite<'a> {
845846
///
846847
/// # Examples
847848
///
848-
/// ```
849+
#[cfg_attr(fbsd14, doc = " ```")]
850+
#[cfg_attr(not(fbsd14), doc = " ```no_run")]
849851
/// # use nix::errno::Errno;
850852
/// # use nix::Error;
851853
/// # use nix::sys::aio::*;

test/sys/test_aio.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ mod aio_read {
201201
}
202202

203203
#[cfg(target_os = "freebsd")]
204+
#[cfg(fbsd14)]
204205
mod aio_readv {
205206
use super::*;
206207
use std::io::IoSliceMut;
@@ -381,6 +382,7 @@ mod aio_write {
381382
}
382383

383384
#[cfg(target_os = "freebsd")]
385+
#[cfg(fbsd14)]
384386
mod aio_writev {
385387
use super::*;
386388
use std::io::IoSlice;

0 commit comments

Comments
 (0)