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

Function test_unix

tests/net/unix.rs:99–132  ·  view source on GitHub ↗

TODO: Investigate why these tests fail on FreeBSD.

()

Source from the content-addressed store, hash-verified

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