Skip to content

Commit e2ce5ef

Browse files
committed
Disable the fspacectl tests
They fail to link prior to FreeBSD 14.0, which we don't use in CI. So mark them as no_run. The only alternative I see would be to add a build script.
1 parent 5419c79 commit e2ce5ef

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

src/fcntl.rs

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,8 @@ impl SpacectlRange {
742742
///
743743
/// # Example
744744
///
745-
/// ```
745+
// no_run because it fails to link until FreeBSD 14.0
746+
/// ```no_run
746747
/// # use std::io::Write;
747748
/// # use std::os::unix::fs::FileExt;
748749
/// # use std::os::unix::io::AsRawFd;
@@ -753,12 +754,7 @@ impl SpacectlRange {
753754
/// f.write_all(INITIAL).unwrap();
754755
/// let mut range = SpacectlRange(3, 6);
755756
/// while (!range.is_empty()) {
756-
/// let r = fspacectl(f.as_raw_fd(), range);
757-
/// # if r == Err(nix::Error::ENOSYS) {
758-
/// # // not supported until FreeBSD 14.0
759-
/// # return;
760-
/// # }
761-
/// range = r.unwrap();
757+
/// range = fspacectl(f.as_raw_fd(), range).unwrap();
762758
/// }
763759
/// let mut buf = vec![0; INITIAL.len()];
764760
/// f.read_exact_at(&mut buf, 0).unwrap();
@@ -792,7 +788,8 @@ pub fn fspacectl(fd: RawFd, range: SpacectlRange) -> Result<SpacectlRange> {
792788
///
793789
/// # Example
794790
///
795-
/// ```
791+
// no_run because it fails to link until FreeBSD 14.0
792+
/// ```no_run
796793
/// # use std::io::Write;
797794
/// # use std::os::unix::fs::FileExt;
798795
/// # use std::os::unix::io::AsRawFd;
@@ -801,12 +798,7 @@ pub fn fspacectl(fd: RawFd, range: SpacectlRange) -> Result<SpacectlRange> {
801798
/// const INITIAL: &[u8] = b"0123456789abcdef";
802799
/// let mut f = tempfile().unwrap();
803800
/// f.write_all(INITIAL).unwrap();
804-
/// let r = fspacectl_all(f.as_raw_fd(), 3, 6);
805-
/// # if r == Err(nix::Error::ENOSYS) {
806-
/// # // not supported until FreeBSD 14.0
807-
/// # return;
808-
/// # }
809-
/// r.unwrap();
801+
/// fspacectl_all(f.as_raw_fd(), 3, 6).unwrap();
810802
/// let mut buf = vec![0; INITIAL.len()];
811803
/// f.read_exact_at(&mut buf, 0).unwrap();
812804
/// assert_eq!(buf, b"012\0\0\0\0\0\09abcdef");

0 commit comments

Comments
 (0)