Skip to content

Commit 2472fd8

Browse files
changes for vxworks
1 parent cd60c60 commit 2472fd8

File tree

2 files changed

+24
-17
lines changed

2 files changed

+24
-17
lines changed

library/std/src/fs/tests.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,7 @@ fn recursive_mkdir_failure() {
716716
}
717717

718718
#[test]
719+
#[cfg_attr(target_os = "vxworks", ignore)]
719720
fn concurrent_recursive_mkdir() {
720721
for _ in 0..100 {
721722
let dir = tmpdir();
@@ -801,8 +802,10 @@ fn recursive_rmdir_of_file_fails() {
801802
let canary = tmpdir.join("do_not_delete");
802803
check!(check!(File::create(&canary)).write(b"foo"));
803804
let result = fs::remove_dir_all(&canary);
804-
#[cfg(unix)]
805+
#[cfg(all(not(target_os = "vxworks"),unix))]
805806
error!(result, "Not a directory");
807+
#[cfg(target_os = "vxworks")]
808+
error!(result, "not a directory");
806809
#[cfg(windows)]
807810
error!(result, 267); // ERROR_DIRECTORY - The directory name is invalid.
808811
assert!(result.is_err());

library/std/src/os/unix/net/tests.rs

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ macro_rules! or_panic {
2121
}
2222

2323
#[test]
24-
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
24+
#[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)]
2525
fn basic() {
2626
let dir = tmpdir();
2727
let socket_path = dir.path().join("sock");
@@ -49,6 +49,7 @@ fn basic() {
4949
}
5050

5151
#[test]
52+
#[cfg_attr(target_os = "vxworks", ignore)]
5253
fn vectored() {
5354
let (mut s1, mut s2) = or_panic!(UnixStream::pair());
5455

@@ -69,6 +70,7 @@ fn vectored() {
6970
}
7071

7172
#[test]
73+
#[cfg_attr(target_os = "vxworks", ignore)]
7274
fn pair() {
7375
let msg1 = b"hello";
7476
let msg2 = b"world!";
@@ -92,7 +94,7 @@ fn pair() {
9294
}
9395

9496
#[test]
95-
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
97+
#[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)]
9698
fn try_clone() {
9799
let dir = tmpdir();
98100
let socket_path = dir.path().join("sock");
@@ -119,7 +121,7 @@ fn try_clone() {
119121
}
120122

121123
#[test]
122-
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
124+
#[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)]
123125
fn iter() {
124126
let dir = tmpdir();
125127
let socket_path = dir.path().join("sock");
@@ -142,6 +144,7 @@ fn iter() {
142144
}
143145

144146
#[test]
147+
#[cfg_attr(target_os = "vxworks", ignore)]
145148
fn long_path() {
146149
let dir = tmpdir();
147150
let socket_path = dir.path().join(
@@ -169,7 +172,7 @@ fn long_path() {
169172

170173
#[test]
171174
#[cfg(not(target_os = "nto"))]
172-
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
175+
#[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)]
173176
fn timeouts() {
174177
let dir = tmpdir();
175178
let socket_path = dir.path().join("sock");
@@ -197,7 +200,7 @@ fn timeouts() {
197200
}
198201

199202
#[test]
200-
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
203+
#[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)]
201204
fn test_read_timeout() {
202205
let dir = tmpdir();
203206
let socket_path = dir.path().join("sock");
@@ -217,7 +220,7 @@ fn test_read_timeout() {
217220
}
218221

219222
#[test]
220-
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
223+
#[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)]
221224
fn test_read_with_timeout() {
222225
let dir = tmpdir();
223226
let socket_path = dir.path().join("sock");
@@ -245,7 +248,7 @@ fn test_read_with_timeout() {
245248
// Ensure the `set_read_timeout` and `set_write_timeout` calls return errors
246249
// when passed zero Durations
247250
#[test]
248-
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
251+
#[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)]
249252
fn test_unix_stream_timeout_zero_duration() {
250253
let dir = tmpdir();
251254
let socket_path = dir.path().join("sock");
@@ -265,7 +268,7 @@ fn test_unix_stream_timeout_zero_duration() {
265268
}
266269

267270
#[test]
268-
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
271+
#[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)]
269272
fn test_unix_datagram() {
270273
let dir = tmpdir();
271274
let path1 = dir.path().join("sock1");
@@ -282,7 +285,7 @@ fn test_unix_datagram() {
282285
}
283286

284287
#[test]
285-
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
288+
#[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)]
286289
fn test_unnamed_unix_datagram() {
287290
let dir = tmpdir();
288291
let path1 = dir.path().join("sock1");
@@ -300,7 +303,7 @@ fn test_unnamed_unix_datagram() {
300303
}
301304

302305
#[test]
303-
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
306+
#[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)]
304307
fn test_unix_datagram_connect_to_recv_addr() {
305308
let dir = tmpdir();
306309
let path1 = dir.path().join("sock1");
@@ -325,7 +328,7 @@ fn test_unix_datagram_connect_to_recv_addr() {
325328
}
326329

327330
#[test]
328-
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
331+
#[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)]
329332
fn test_connect_unix_datagram() {
330333
let dir = tmpdir();
331334
let path1 = dir.path().join("sock1");
@@ -352,7 +355,7 @@ fn test_connect_unix_datagram() {
352355
}
353356

354357
#[test]
355-
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
358+
#[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)]
356359
fn test_unix_datagram_recv() {
357360
let dir = tmpdir();
358361
let path1 = dir.path().join("sock1");
@@ -370,6 +373,7 @@ fn test_unix_datagram_recv() {
370373
}
371374

372375
#[test]
376+
#[cfg_attr(target_os = "vxworks", ignore)]
373377
fn datagram_pair() {
374378
let msg1 = b"hello";
375379
let msg2 = b"world!";
@@ -395,7 +399,7 @@ fn datagram_pair() {
395399
// Ensure the `set_read_timeout` and `set_write_timeout` calls return errors
396400
// when passed zero Durations
397401
#[test]
398-
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
402+
#[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)]
399403
fn test_unix_datagram_timeout_zero_duration() {
400404
let dir = tmpdir();
401405
let path = dir.path().join("sock");
@@ -549,7 +553,7 @@ fn test_abstract_no_pathname_and_not_unnamed() {
549553
}
550554

551555
#[test]
552-
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
556+
#[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)]
553557
fn test_unix_stream_peek() {
554558
let (txdone, rxdone) = crate::sync::mpsc::channel();
555559

@@ -582,7 +586,7 @@ fn test_unix_stream_peek() {
582586
}
583587

584588
#[test]
585-
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
589+
#[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)]
586590
fn test_unix_datagram_peek() {
587591
let dir = tmpdir();
588592
let path1 = dir.path().join("sock");
@@ -607,7 +611,7 @@ fn test_unix_datagram_peek() {
607611
}
608612

609613
#[test]
610-
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
614+
#[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)]
611615
fn test_unix_datagram_peek_from() {
612616
let dir = tmpdir();
613617
let path1 = dir.path().join("sock");

0 commit comments

Comments
 (0)