Skip to content

Commit bed5c48

Browse files
committed
Fix test compilation with restricted feature sets.
Add `cfg`s to fix build errors.
1 parent 52f1af8 commit bed5c48

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

tests/event/select.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ fn test_select_with_pipes() {
8282
}
8383

8484
#[cfg(feature = "pipe")]
85+
#[cfg(feature = "process")]
8586
#[cfg(not(windows))]
8687
#[test]
8788
#[serial] // for `setrlimit` usage
@@ -271,6 +272,7 @@ fn test_select_with_sockets() {
271272
// Like `test_select_with_sockets` but test with the maximum permitted
272273
// fd value.
273274
#[cfg(feature = "net")]
275+
#[cfg(feature = "process")]
274276
#[cfg(not(windows))] // for `dup2` usage
275277
#[test]
276278
#[serial] // for `setrlimit` usage, and `crate::init`

tests/fs/special.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#[cfg(feature = "process")]
12
#[cfg(not(target_os = "wasi"))]
23
#[test]
34
fn test_special_fds() {

tests/io_uring/register.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use rustix::io_uring::{
88
io_uring_rsrc_update, io_uring_setup, IoringFeatureFlags, IoringRegisterFlags,
99
IoringRegisterOp,
1010
};
11+
#[cfg(feature = "mm")]
1112
use rustix::mm::{MapFlags, ProtFlags};
1213

1314
fn do_register<FD>(
@@ -122,6 +123,7 @@ fn test_io_uring_register_with() {
122123
register_result.unwrap();
123124
}
124125

126+
#[cfg(feature = "mm")]
125127
#[test]
126128
fn io_uring_buf_ring_can_be_registered() {
127129
const ENTRIES: usize = 8;

0 commit comments

Comments
 (0)