diff options
| author | Brian Anderson <banderson@mozilla.com> | 2016-09-14 17:10:43 +0000 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2016-09-30 14:02:52 -0700 |
| commit | 183b2ddce4771df3bcfe36eb229a1791fe4b0f8f (patch) | |
| tree | eb9c8b8990972cbc42a4ca74399cbbad81415f23 /src/libstd/net | |
| parent | 37abec06e502b147b9ebc730030efe10bf235765 (diff) | |
| download | rust-183b2ddce4771df3bcfe36eb229a1791fe4b0f8f.tar.gz rust-183b2ddce4771df3bcfe36eb229a1791fe4b0f8f.zip | |
Ignore entire test modules on emscripten instead of individual tests
Diffstat (limited to 'src/libstd/net')
| -rw-r--r-- | src/libstd/net/addr.rs | 2 | ||||
| -rw-r--r-- | src/libstd/net/ip.rs | 2 | ||||
| -rw-r--r-- | src/libstd/net/mod.rs | 3 | ||||
| -rw-r--r-- | src/libstd/net/tcp.rs | 32 | ||||
| -rw-r--r-- | src/libstd/net/udp.rs | 15 |
5 files changed, 6 insertions, 48 deletions
diff --git a/src/libstd/net/addr.rs b/src/libstd/net/addr.rs index 930f2c721a7..a77d83a23ce 100644 --- a/src/libstd/net/addr.rs +++ b/src/libstd/net/addr.rs @@ -519,7 +519,7 @@ impl<'a, T: ToSocketAddrs + ?Sized> ToSocketAddrs for &'a T { } } -#[cfg(test)] +#[cfg(all(test, not(target_os = "emscripten")))] mod tests { use net::*; use net::test::{tsa, sa6, sa4}; diff --git a/src/libstd/net/ip.rs b/src/libstd/net/ip.rs index 05ef559422f..ba2cd70e0d7 100644 --- a/src/libstd/net/ip.rs +++ b/src/libstd/net/ip.rs @@ -669,7 +669,7 @@ impl From<[u8; 16]> for Ipv6Addr { } // Tests for this module -#[cfg(test)] +#[cfg(all(test, not(target_os = "emscripten")))] mod tests { use net::*; use net::Ipv6MulticastScope::*; diff --git a/src/libstd/net/mod.rs b/src/libstd/net/mod.rs index ad2fe3c1c0d..7dd0e30df03 100644 --- a/src/libstd/net/mod.rs +++ b/src/libstd/net/mod.rs @@ -31,7 +31,8 @@ mod addr; mod tcp; mod udp; mod parser; -#[cfg(test)] mod test; +#[cfg(all(test, not(target_os = "emscripten")))] +mod test; /// Possible values which can be passed to the [`shutdown`] method of /// [`TcpStream`]. diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs index d34fce2be43..0e7c5b06713 100644 --- a/src/libstd/net/tcp.rs +++ b/src/libstd/net/tcp.rs @@ -428,7 +428,7 @@ impl fmt::Debug for TcpListener { } } -#[cfg(test)] +#[cfg(all(test, not(target_os = "emscripten")))] mod tests { use io::ErrorKind; use io::prelude::*; @@ -454,7 +454,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn bind_error() { match TcpListener::bind("1.1.1.1:9999") { Ok(..) => panic!(), @@ -464,7 +463,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn connect_error() { match TcpStream::connect("0.0.0.0:1") { Ok(..) => panic!(), @@ -477,7 +475,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn listen_localhost() { let socket_addr = next_test_ip4(); let listener = t!(TcpListener::bind(&socket_addr)); @@ -495,7 +492,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn connect_loopback() { each_ip(&mut |addr| { let acceptor = t!(TcpListener::bind(&addr)); @@ -517,7 +513,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn smoke_test() { each_ip(&mut |addr| { let acceptor = t!(TcpListener::bind(&addr)); @@ -538,7 +533,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn read_eof() { each_ip(&mut |addr| { let acceptor = t!(TcpListener::bind(&addr)); @@ -558,7 +552,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn write_close() { each_ip(&mut |addr| { let acceptor = t!(TcpListener::bind(&addr)); @@ -585,7 +578,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn multiple_connect_serial() { each_ip(&mut |addr| { let max = 10; @@ -608,7 +600,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn multiple_connect_interleaved_greedy_schedule() { const MAX: usize = 10; each_ip(&mut |addr| { @@ -644,7 +635,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn multiple_connect_interleaved_lazy_schedule() { const MAX: usize = 10; each_ip(&mut |addr| { @@ -678,7 +668,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn socket_and_peer_name() { each_ip(&mut |addr| { let listener = t!(TcpListener::bind(&addr)); @@ -694,7 +683,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn partial_read() { each_ip(&mut |addr| { let (tx, rx) = channel(); @@ -716,7 +704,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn double_bind() { each_ip(&mut |addr| { let _listener = t!(TcpListener::bind(&addr)); @@ -733,7 +720,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn fast_rebind() { each_ip(&mut |addr| { let acceptor = t!(TcpListener::bind(&addr)); @@ -749,7 +735,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn tcp_clone_smoke() { each_ip(&mut |addr| { let acceptor = t!(TcpListener::bind(&addr)); @@ -781,7 +766,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn tcp_clone_two_read() { each_ip(&mut |addr| { let acceptor = t!(TcpListener::bind(&addr)); @@ -816,7 +800,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn tcp_clone_two_write() { each_ip(&mut |addr| { let acceptor = t!(TcpListener::bind(&addr)); @@ -844,7 +827,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn shutdown_smoke() { each_ip(&mut |addr| { let a = t!(TcpListener::bind(&addr)); @@ -865,7 +847,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn close_readwrite_smoke() { each_ip(&mut |addr| { let a = t!(TcpListener::bind(&addr)); @@ -904,7 +885,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn close_read_wakes_up() { each_ip(&mut |addr| { let a = t!(TcpListener::bind(&addr)); @@ -932,7 +912,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn clone_while_reading() { each_ip(&mut |addr| { let accept = t!(TcpListener::bind(&addr)); @@ -973,7 +952,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn clone_accept_smoke() { each_ip(&mut |addr| { let a = t!(TcpListener::bind(&addr)); @@ -992,7 +970,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn clone_accept_concurrent() { each_ip(&mut |addr| { let a = t!(TcpListener::bind(&addr)); @@ -1021,7 +998,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn debug() { let name = if cfg!(windows) {"socket"} else {"fd"}; let socket_addr = next_test_ip4(); @@ -1048,7 +1024,6 @@ mod tests { // no longer has rounding errors. #[cfg_attr(any(target_os = "bitrig", target_os = "netbsd", target_os = "openbsd"), ignore)] #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn timeouts() { let addr = next_test_ip4(); let listener = t!(TcpListener::bind(&addr)); @@ -1075,7 +1050,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn test_read_timeout() { let addr = next_test_ip4(); let listener = t!(TcpListener::bind(&addr)); @@ -1092,7 +1066,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn test_read_with_timeout() { let addr = next_test_ip4(); let listener = t!(TcpListener::bind(&addr)); @@ -1115,7 +1088,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn nodelay() { let addr = next_test_ip4(); let _listener = t!(TcpListener::bind(&addr)); @@ -1130,7 +1102,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn ttl() { let ttl = 100; @@ -1147,7 +1118,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn set_nonblocking() { let addr = next_test_ip4(); let listener = t!(TcpListener::bind(&addr)); diff --git a/src/libstd/net/udp.rs b/src/libstd/net/udp.rs index 7315b6aaeb6..c03ac496adb 100644 --- a/src/libstd/net/udp.rs +++ b/src/libstd/net/udp.rs @@ -353,7 +353,7 @@ impl fmt::Debug for UdpSocket { } } -#[cfg(test)] +#[cfg(all(test, not(target_os = "emscripten")))] mod tests { use io::ErrorKind; use net::*; @@ -378,7 +378,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn bind_error() { match UdpSocket::bind("1.1.1.1:9999") { Ok(..) => panic!(), @@ -389,7 +388,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn socket_smoke_test_ip4() { each_ip(&mut |server_ip, client_ip| { let (tx1, rx1) = channel(); @@ -414,7 +412,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn socket_name_ip4() { each_ip(&mut |addr, _| { let server = t!(UdpSocket::bind(&addr)); @@ -423,7 +420,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn udp_clone_smoke() { each_ip(&mut |addr1, addr2| { let sock1 = t!(UdpSocket::bind(&addr1)); @@ -453,7 +449,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn udp_clone_two_read() { each_ip(&mut |addr1, addr2| { let sock1 = t!(UdpSocket::bind(&addr1)); @@ -486,7 +481,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn udp_clone_two_write() { each_ip(&mut |addr1, addr2| { let sock1 = t!(UdpSocket::bind(&addr1)); @@ -525,7 +519,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn debug() { let name = if cfg!(windows) {"socket"} else {"fd"}; let socket_addr = next_test_ip4(); @@ -541,7 +534,6 @@ mod tests { // no longer has rounding errors. #[cfg_attr(any(target_os = "bitrig", target_os = "netbsd", target_os = "openbsd"), ignore)] #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn timeouts() { let addr = next_test_ip4(); @@ -566,7 +558,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn test_read_timeout() { let addr = next_test_ip4(); @@ -582,7 +573,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn test_read_with_timeout() { let addr = next_test_ip4(); @@ -602,7 +592,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn connect_send_recv() { let addr = next_test_ip4(); @@ -617,7 +606,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn ttl() { let ttl = 100; @@ -630,7 +618,6 @@ mod tests { } #[test] - #[cfg_attr(target_os = "emscripten", ignore)] fn set_nonblocking() { let addr = next_test_ip4(); |
