@@ -57,6 +57,7 @@ fn connect_timeout_error() {
5757}
5858
5959#[ test]
60+ #[ cfg_attr( target_os = "wasi" , ignore) ] // no threads
6061fn listen_localhost ( ) {
6162 let socket_addr = next_test_ip4 ( ) ;
6263 let listener = t ! ( TcpListener :: bind( & socket_addr) ) ;
@@ -73,6 +74,7 @@ fn listen_localhost() {
7374}
7475
7576#[ test]
77+ #[ cfg_attr( target_os = "wasi" , ignore) ] // no threads
7678fn connect_loopback ( ) {
7779 each_ip ( & mut |addr| {
7880 let acceptor = t ! ( TcpListener :: bind( & addr) ) ;
@@ -94,6 +96,7 @@ fn connect_loopback() {
9496}
9597
9698#[ test]
99+ #[ cfg_attr( target_os = "wasi" , ignore) ] // no threads
97100fn smoke_test ( ) {
98101 each_ip ( & mut |addr| {
99102 let acceptor = t ! ( TcpListener :: bind( & addr) ) ;
@@ -114,6 +117,7 @@ fn smoke_test() {
114117}
115118
116119#[ test]
120+ #[ cfg_attr( target_os = "wasi" , ignore) ] // no threads
117121fn read_eof ( ) {
118122 each_ip ( & mut |addr| {
119123 let acceptor = t ! ( TcpListener :: bind( & addr) ) ;
@@ -133,6 +137,7 @@ fn read_eof() {
133137}
134138
135139#[ test]
140+ #[ cfg_attr( target_os = "wasi" , ignore) ] // no threads
136141fn write_close ( ) {
137142 each_ip ( & mut |addr| {
138143 let acceptor = t ! ( TcpListener :: bind( & addr) ) ;
@@ -161,6 +166,7 @@ fn write_close() {
161166}
162167
163168#[ test]
169+ #[ cfg_attr( target_os = "wasi" , ignore) ] // no threads
164170fn multiple_connect_serial ( ) {
165171 each_ip ( & mut |addr| {
166172 let max = 10 ;
@@ -183,6 +189,7 @@ fn multiple_connect_serial() {
183189}
184190
185191#[ test]
192+ #[ cfg_attr( target_os = "wasi" , ignore) ] // no threads
186193fn multiple_connect_interleaved_greedy_schedule ( ) {
187194 const MAX : usize = 10 ;
188195 each_ip ( & mut |addr| {
@@ -220,6 +227,7 @@ fn multiple_connect_interleaved_greedy_schedule() {
220227}
221228
222229#[ test]
230+ #[ cfg_attr( target_os = "wasi" , ignore) ] // no threads
223231fn multiple_connect_interleaved_lazy_schedule ( ) {
224232 const MAX : usize = 10 ;
225233 each_ip ( & mut |addr| {
@@ -255,6 +263,7 @@ fn multiple_connect_interleaved_lazy_schedule() {
255263}
256264
257265#[ test]
266+ #[ cfg_attr( target_os = "wasi" , ignore) ] // no threads
258267fn socket_and_peer_name ( ) {
259268 each_ip ( & mut |addr| {
260269 let listener = t ! ( TcpListener :: bind( & addr) ) ;
@@ -270,6 +279,7 @@ fn socket_and_peer_name() {
270279}
271280
272281#[ test]
282+ #[ cfg_attr( target_os = "wasi" , ignore) ] // no threads
273283fn partial_read ( ) {
274284 each_ip ( & mut |addr| {
275285 let ( tx, rx) = channel ( ) ;
@@ -291,6 +301,7 @@ fn partial_read() {
291301}
292302
293303#[ test]
304+ #[ cfg_attr( target_os = "wasi" , ignore) ] // no threads
294305fn read_buf ( ) {
295306 each_ip ( & mut |addr| {
296307 let srv = t ! ( TcpListener :: bind( & addr) ) ;
@@ -389,6 +400,7 @@ fn double_bind() {
389400}
390401
391402#[ test]
403+ #[ cfg_attr( target_os = "wasi" , ignore) ] // no threads
392404fn tcp_clone_smoke ( ) {
393405 each_ip ( & mut |addr| {
394406 let acceptor = t ! ( TcpListener :: bind( & addr) ) ;
@@ -420,6 +432,7 @@ fn tcp_clone_smoke() {
420432}
421433
422434#[ test]
435+ #[ cfg_attr( target_os = "wasi" , ignore) ] // no threads
423436fn tcp_clone_two_read ( ) {
424437 each_ip ( & mut |addr| {
425438 let acceptor = t ! ( TcpListener :: bind( & addr) ) ;
@@ -454,6 +467,7 @@ fn tcp_clone_two_read() {
454467}
455468
456469#[ test]
470+ #[ cfg_attr( target_os = "wasi" , ignore) ] // no threads
457471fn tcp_clone_two_write ( ) {
458472 each_ip ( & mut |addr| {
459473 let acceptor = t ! ( TcpListener :: bind( & addr) ) ;
@@ -483,6 +497,7 @@ fn tcp_clone_two_write() {
483497#[ test]
484498// FIXME: https://github.com/fortanix/rust-sgx/issues/110
485499#[ cfg_attr( target_env = "sgx" , ignore) ]
500+ #[ cfg_attr( target_os = "wasi" , ignore) ] // no threads
486501fn shutdown_smoke ( ) {
487502 each_ip ( & mut |addr| {
488503 let a = t ! ( TcpListener :: bind( & addr) ) ;
@@ -505,6 +520,7 @@ fn shutdown_smoke() {
505520#[ test]
506521// FIXME: https://github.com/fortanix/rust-sgx/issues/110
507522#[ cfg_attr( target_env = "sgx" , ignore) ]
523+ #[ cfg_attr( target_os = "wasi" , ignore) ] // no threads
508524fn close_readwrite_smoke ( ) {
509525 each_ip ( & mut |addr| {
510526 let a = t ! ( TcpListener :: bind( & addr) ) ;
@@ -547,6 +563,7 @@ fn close_readwrite_smoke() {
547563#[ cfg_attr( target_env = "sgx" , ignore) ]
548564// On windows, shutdown will not wake up blocking I/O operations.
549565#[ cfg_attr( windows, ignore) ]
566+ #[ cfg_attr( target_os = "wasi" , ignore) ] // no threads
550567fn close_read_wakes_up ( ) {
551568 each_ip ( & mut |addr| {
552569 let listener = t ! ( TcpListener :: bind( & addr) ) ;
@@ -574,6 +591,7 @@ fn close_read_wakes_up() {
574591}
575592
576593#[ test]
594+ #[ cfg_attr( target_os = "wasi" , ignore) ] // no threads
577595fn clone_while_reading ( ) {
578596 each_ip ( & mut |addr| {
579597 let accept = t ! ( TcpListener :: bind( & addr) ) ;
@@ -614,6 +632,7 @@ fn clone_while_reading() {
614632}
615633
616634#[ test]
635+ #[ cfg_attr( target_os = "wasi" , ignore) ] // no threads
617636fn clone_accept_smoke ( ) {
618637 each_ip ( & mut |addr| {
619638 let a = t ! ( TcpListener :: bind( & addr) ) ;
@@ -632,6 +651,7 @@ fn clone_accept_smoke() {
632651}
633652
634653#[ test]
654+ #[ cfg_attr( target_os = "wasi" , ignore) ] // no threads
635655fn clone_accept_concurrent ( ) {
636656 each_ip ( & mut |addr| {
637657 let a = t ! ( TcpListener :: bind( & addr) ) ;
@@ -670,10 +690,10 @@ fn debug() {
670690 addr. to_string ( )
671691 }
672692
693+ #[ cfg( any( unix, target_os = "wasi" ) ) ]
694+ use crate :: os:: fd:: AsRawFd ;
673695 #[ cfg( target_env = "sgx" ) ]
674696 use crate :: os:: fortanix_sgx:: io:: AsRawFd ;
675- #[ cfg( unix) ]
676- use crate :: os:: unix:: io:: AsRawFd ;
677697 #[ cfg( not( windows) ) ]
678698 fn render_inner ( addr : & dyn AsRawFd ) -> impl fmt:: Debug {
679699 addr. as_raw_fd ( )
@@ -714,6 +734,7 @@ fn debug() {
714734 ignore
715735) ]
716736#[ cfg_attr( target_env = "sgx" , ignore) ] // FIXME: https://github.com/fortanix/rust-sgx/issues/31
737+ #[ cfg_attr( target_os = "wasi" , ignore) ] // timeout not supported
717738#[ test]
718739fn timeouts ( ) {
719740 let addr = next_test_ip4 ( ) ;
@@ -742,6 +763,7 @@ fn timeouts() {
742763
743764#[ test]
744765#[ cfg_attr( target_env = "sgx" , ignore) ] // FIXME: https://github.com/fortanix/rust-sgx/issues/31
766+ #[ cfg_attr( target_os = "wasi" , ignore) ] // timeout not supported
745767fn test_read_timeout ( ) {
746768 let addr = next_test_ip4 ( ) ;
747769 let listener = t ! ( TcpListener :: bind( & addr) ) ;
@@ -763,6 +785,7 @@ fn test_read_timeout() {
763785
764786#[ test]
765787#[ cfg_attr( target_env = "sgx" , ignore) ] // FIXME: https://github.com/fortanix/rust-sgx/issues/31
788+ #[ cfg_attr( target_os = "wasi" , ignore) ] // timeout not supported
766789fn test_read_with_timeout ( ) {
767790 let addr = next_test_ip4 ( ) ;
768791 let listener = t ! ( TcpListener :: bind( & addr) ) ;
@@ -810,6 +833,7 @@ fn test_timeout_zero_duration() {
810833
811834#[ test]
812835#[ cfg_attr( target_env = "sgx" , ignore) ]
836+ #[ cfg_attr( target_os = "wasi" , ignore) ] // linger not supported
813837fn linger ( ) {
814838 let addr = next_test_ip4 ( ) ;
815839 let _listener = t ! ( TcpListener :: bind( & addr) ) ;
@@ -879,6 +903,7 @@ fn set_nonblocking() {
879903
880904#[ test]
881905#[ cfg_attr( target_env = "sgx" , ignore) ] // FIXME: https://github.com/fortanix/rust-sgx/issues/31
906+ #[ cfg_attr( target_os = "wasi" , ignore) ] // no threads
882907fn peek ( ) {
883908 each_ip ( & mut |addr| {
884909 let ( txdone, rxdone) = channel ( ) ;
0 commit comments