MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / test_unix

Function test_unix

tests/net/unix_alloc.rs:96–129  ·  view source on GitHub ↗

TODO: Investigate why these tests fail on FreeBSD.

()

Source from the content-addressed store, hash-verified

94#[test]
95#[cfg(not(target_os = "freebsd"))] // TODO: Investigate why these tests fail on FreeBSD.
96fn test_unix() {
97 crate::init();
98
99 let ready = Arc::new((Mutex::new(false), Condvar::new()));
100 let ready_clone = Arc::clone(&ready);
101
102 let tmp = tempfile::tempdir().unwrap();
103 let path = tmp.path().join("soccer");
104 let send_path = path.to_owned();
105 let server = thread::Builder::new()
106 .name("server".to_string())
107 .spawn(move || {
108 server(ready, &send_path);
109 })
110 .unwrap();
111 let send_path = path.to_owned();
112 let client = thread::Builder::new()
113 .name("client".to_string())
114 .spawn(move || {
115 client(
116 ready_clone,
117 &send_path,
118 &[
119 (&["1", "2"], 3),
120 (&["4", "77", "103"], 184),
121 (&["5", "78", "104"], 187),
122 (&[], 0),
123 ],
124 );
125 })
126 .unwrap();
127 client.join().unwrap();
128 server.join().unwrap();
129}
130
131#[cfg(not(any(target_os = "espidf", target_os = "redox", target_os = "wasi")))]
132#[cfg(not(target_os = "freebsd"))] // TODO: Investigate why these tests fail on FreeBSD.

Callers

nothing calls this directly

Calls 4

initFunction · 0.70
serverFunction · 0.70
clientFunction · 0.70
pathMethod · 0.45

Tested by

no test coverage detected