Ignore entire test modules on emscripten instead of individual tests
This commit is contained in:
parent
37abec06e5
commit
183b2ddce4
8 changed files with 10 additions and 132 deletions
|
@ -519,7 +519,7 @@ impl<'a, T: ToSocketAddrs + ?Sized> ToSocketAddrs for &'a T {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(all(test, not(target_os = "emscripten")))]
|
||||||
mod tests {
|
mod tests {
|
||||||
use net::*;
|
use net::*;
|
||||||
use net::test::{tsa, sa6, sa4};
|
use net::test::{tsa, sa6, sa4};
|
||||||
|
|
|
@ -669,7 +669,7 @@ impl From<[u8; 16]> for Ipv6Addr {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tests for this module
|
// Tests for this module
|
||||||
#[cfg(test)]
|
#[cfg(all(test, not(target_os = "emscripten")))]
|
||||||
mod tests {
|
mod tests {
|
||||||
use net::*;
|
use net::*;
|
||||||
use net::Ipv6MulticastScope::*;
|
use net::Ipv6MulticastScope::*;
|
||||||
|
|
|
@ -31,7 +31,8 @@ mod addr;
|
||||||
mod tcp;
|
mod tcp;
|
||||||
mod udp;
|
mod udp;
|
||||||
mod parser;
|
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
|
/// Possible values which can be passed to the [`shutdown`] method of
|
||||||
/// [`TcpStream`].
|
/// [`TcpStream`].
|
||||||
|
|
|
@ -428,7 +428,7 @@ impl fmt::Debug for TcpListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(all(test, not(target_os = "emscripten")))]
|
||||||
mod tests {
|
mod tests {
|
||||||
use io::ErrorKind;
|
use io::ErrorKind;
|
||||||
use io::prelude::*;
|
use io::prelude::*;
|
||||||
|
@ -454,7 +454,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn bind_error() {
|
fn bind_error() {
|
||||||
match TcpListener::bind("1.1.1.1:9999") {
|
match TcpListener::bind("1.1.1.1:9999") {
|
||||||
Ok(..) => panic!(),
|
Ok(..) => panic!(),
|
||||||
|
@ -464,7 +463,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn connect_error() {
|
fn connect_error() {
|
||||||
match TcpStream::connect("0.0.0.0:1") {
|
match TcpStream::connect("0.0.0.0:1") {
|
||||||
Ok(..) => panic!(),
|
Ok(..) => panic!(),
|
||||||
|
@ -477,7 +475,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn listen_localhost() {
|
fn listen_localhost() {
|
||||||
let socket_addr = next_test_ip4();
|
let socket_addr = next_test_ip4();
|
||||||
let listener = t!(TcpListener::bind(&socket_addr));
|
let listener = t!(TcpListener::bind(&socket_addr));
|
||||||
|
@ -495,7 +492,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn connect_loopback() {
|
fn connect_loopback() {
|
||||||
each_ip(&mut |addr| {
|
each_ip(&mut |addr| {
|
||||||
let acceptor = t!(TcpListener::bind(&addr));
|
let acceptor = t!(TcpListener::bind(&addr));
|
||||||
|
@ -517,7 +513,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn smoke_test() {
|
fn smoke_test() {
|
||||||
each_ip(&mut |addr| {
|
each_ip(&mut |addr| {
|
||||||
let acceptor = t!(TcpListener::bind(&addr));
|
let acceptor = t!(TcpListener::bind(&addr));
|
||||||
|
@ -538,7 +533,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn read_eof() {
|
fn read_eof() {
|
||||||
each_ip(&mut |addr| {
|
each_ip(&mut |addr| {
|
||||||
let acceptor = t!(TcpListener::bind(&addr));
|
let acceptor = t!(TcpListener::bind(&addr));
|
||||||
|
@ -558,7 +552,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn write_close() {
|
fn write_close() {
|
||||||
each_ip(&mut |addr| {
|
each_ip(&mut |addr| {
|
||||||
let acceptor = t!(TcpListener::bind(&addr));
|
let acceptor = t!(TcpListener::bind(&addr));
|
||||||
|
@ -585,7 +578,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn multiple_connect_serial() {
|
fn multiple_connect_serial() {
|
||||||
each_ip(&mut |addr| {
|
each_ip(&mut |addr| {
|
||||||
let max = 10;
|
let max = 10;
|
||||||
|
@ -608,7 +600,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn multiple_connect_interleaved_greedy_schedule() {
|
fn multiple_connect_interleaved_greedy_schedule() {
|
||||||
const MAX: usize = 10;
|
const MAX: usize = 10;
|
||||||
each_ip(&mut |addr| {
|
each_ip(&mut |addr| {
|
||||||
|
@ -644,7 +635,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn multiple_connect_interleaved_lazy_schedule() {
|
fn multiple_connect_interleaved_lazy_schedule() {
|
||||||
const MAX: usize = 10;
|
const MAX: usize = 10;
|
||||||
each_ip(&mut |addr| {
|
each_ip(&mut |addr| {
|
||||||
|
@ -678,7 +668,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn socket_and_peer_name() {
|
fn socket_and_peer_name() {
|
||||||
each_ip(&mut |addr| {
|
each_ip(&mut |addr| {
|
||||||
let listener = t!(TcpListener::bind(&addr));
|
let listener = t!(TcpListener::bind(&addr));
|
||||||
|
@ -694,7 +683,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn partial_read() {
|
fn partial_read() {
|
||||||
each_ip(&mut |addr| {
|
each_ip(&mut |addr| {
|
||||||
let (tx, rx) = channel();
|
let (tx, rx) = channel();
|
||||||
|
@ -716,7 +704,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn double_bind() {
|
fn double_bind() {
|
||||||
each_ip(&mut |addr| {
|
each_ip(&mut |addr| {
|
||||||
let _listener = t!(TcpListener::bind(&addr));
|
let _listener = t!(TcpListener::bind(&addr));
|
||||||
|
@ -733,7 +720,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn fast_rebind() {
|
fn fast_rebind() {
|
||||||
each_ip(&mut |addr| {
|
each_ip(&mut |addr| {
|
||||||
let acceptor = t!(TcpListener::bind(&addr));
|
let acceptor = t!(TcpListener::bind(&addr));
|
||||||
|
@ -749,7 +735,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn tcp_clone_smoke() {
|
fn tcp_clone_smoke() {
|
||||||
each_ip(&mut |addr| {
|
each_ip(&mut |addr| {
|
||||||
let acceptor = t!(TcpListener::bind(&addr));
|
let acceptor = t!(TcpListener::bind(&addr));
|
||||||
|
@ -781,7 +766,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn tcp_clone_two_read() {
|
fn tcp_clone_two_read() {
|
||||||
each_ip(&mut |addr| {
|
each_ip(&mut |addr| {
|
||||||
let acceptor = t!(TcpListener::bind(&addr));
|
let acceptor = t!(TcpListener::bind(&addr));
|
||||||
|
@ -816,7 +800,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn tcp_clone_two_write() {
|
fn tcp_clone_two_write() {
|
||||||
each_ip(&mut |addr| {
|
each_ip(&mut |addr| {
|
||||||
let acceptor = t!(TcpListener::bind(&addr));
|
let acceptor = t!(TcpListener::bind(&addr));
|
||||||
|
@ -844,7 +827,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn shutdown_smoke() {
|
fn shutdown_smoke() {
|
||||||
each_ip(&mut |addr| {
|
each_ip(&mut |addr| {
|
||||||
let a = t!(TcpListener::bind(&addr));
|
let a = t!(TcpListener::bind(&addr));
|
||||||
|
@ -865,7 +847,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn close_readwrite_smoke() {
|
fn close_readwrite_smoke() {
|
||||||
each_ip(&mut |addr| {
|
each_ip(&mut |addr| {
|
||||||
let a = t!(TcpListener::bind(&addr));
|
let a = t!(TcpListener::bind(&addr));
|
||||||
|
@ -904,7 +885,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn close_read_wakes_up() {
|
fn close_read_wakes_up() {
|
||||||
each_ip(&mut |addr| {
|
each_ip(&mut |addr| {
|
||||||
let a = t!(TcpListener::bind(&addr));
|
let a = t!(TcpListener::bind(&addr));
|
||||||
|
@ -932,7 +912,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn clone_while_reading() {
|
fn clone_while_reading() {
|
||||||
each_ip(&mut |addr| {
|
each_ip(&mut |addr| {
|
||||||
let accept = t!(TcpListener::bind(&addr));
|
let accept = t!(TcpListener::bind(&addr));
|
||||||
|
@ -973,7 +952,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn clone_accept_smoke() {
|
fn clone_accept_smoke() {
|
||||||
each_ip(&mut |addr| {
|
each_ip(&mut |addr| {
|
||||||
let a = t!(TcpListener::bind(&addr));
|
let a = t!(TcpListener::bind(&addr));
|
||||||
|
@ -992,7 +970,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn clone_accept_concurrent() {
|
fn clone_accept_concurrent() {
|
||||||
each_ip(&mut |addr| {
|
each_ip(&mut |addr| {
|
||||||
let a = t!(TcpListener::bind(&addr));
|
let a = t!(TcpListener::bind(&addr));
|
||||||
|
@ -1021,7 +998,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn debug() {
|
fn debug() {
|
||||||
let name = if cfg!(windows) {"socket"} else {"fd"};
|
let name = if cfg!(windows) {"socket"} else {"fd"};
|
||||||
let socket_addr = next_test_ip4();
|
let socket_addr = next_test_ip4();
|
||||||
|
@ -1048,7 +1024,6 @@ mod tests {
|
||||||
// no longer has rounding errors.
|
// no longer has rounding errors.
|
||||||
#[cfg_attr(any(target_os = "bitrig", target_os = "netbsd", target_os = "openbsd"), ignore)]
|
#[cfg_attr(any(target_os = "bitrig", target_os = "netbsd", target_os = "openbsd"), ignore)]
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn timeouts() {
|
fn timeouts() {
|
||||||
let addr = next_test_ip4();
|
let addr = next_test_ip4();
|
||||||
let listener = t!(TcpListener::bind(&addr));
|
let listener = t!(TcpListener::bind(&addr));
|
||||||
|
@ -1075,7 +1050,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn test_read_timeout() {
|
fn test_read_timeout() {
|
||||||
let addr = next_test_ip4();
|
let addr = next_test_ip4();
|
||||||
let listener = t!(TcpListener::bind(&addr));
|
let listener = t!(TcpListener::bind(&addr));
|
||||||
|
@ -1092,7 +1066,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn test_read_with_timeout() {
|
fn test_read_with_timeout() {
|
||||||
let addr = next_test_ip4();
|
let addr = next_test_ip4();
|
||||||
let listener = t!(TcpListener::bind(&addr));
|
let listener = t!(TcpListener::bind(&addr));
|
||||||
|
@ -1115,7 +1088,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn nodelay() {
|
fn nodelay() {
|
||||||
let addr = next_test_ip4();
|
let addr = next_test_ip4();
|
||||||
let _listener = t!(TcpListener::bind(&addr));
|
let _listener = t!(TcpListener::bind(&addr));
|
||||||
|
@ -1130,7 +1102,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn ttl() {
|
fn ttl() {
|
||||||
let ttl = 100;
|
let ttl = 100;
|
||||||
|
|
||||||
|
@ -1147,7 +1118,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn set_nonblocking() {
|
fn set_nonblocking() {
|
||||||
let addr = next_test_ip4();
|
let addr = next_test_ip4();
|
||||||
let listener = t!(TcpListener::bind(&addr));
|
let listener = t!(TcpListener::bind(&addr));
|
||||||
|
|
|
@ -353,7 +353,7 @@ impl fmt::Debug for UdpSocket {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(all(test, not(target_os = "emscripten")))]
|
||||||
mod tests {
|
mod tests {
|
||||||
use io::ErrorKind;
|
use io::ErrorKind;
|
||||||
use net::*;
|
use net::*;
|
||||||
|
@ -378,7 +378,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn bind_error() {
|
fn bind_error() {
|
||||||
match UdpSocket::bind("1.1.1.1:9999") {
|
match UdpSocket::bind("1.1.1.1:9999") {
|
||||||
Ok(..) => panic!(),
|
Ok(..) => panic!(),
|
||||||
|
@ -389,7 +388,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn socket_smoke_test_ip4() {
|
fn socket_smoke_test_ip4() {
|
||||||
each_ip(&mut |server_ip, client_ip| {
|
each_ip(&mut |server_ip, client_ip| {
|
||||||
let (tx1, rx1) = channel();
|
let (tx1, rx1) = channel();
|
||||||
|
@ -414,7 +412,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn socket_name_ip4() {
|
fn socket_name_ip4() {
|
||||||
each_ip(&mut |addr, _| {
|
each_ip(&mut |addr, _| {
|
||||||
let server = t!(UdpSocket::bind(&addr));
|
let server = t!(UdpSocket::bind(&addr));
|
||||||
|
@ -423,7 +420,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn udp_clone_smoke() {
|
fn udp_clone_smoke() {
|
||||||
each_ip(&mut |addr1, addr2| {
|
each_ip(&mut |addr1, addr2| {
|
||||||
let sock1 = t!(UdpSocket::bind(&addr1));
|
let sock1 = t!(UdpSocket::bind(&addr1));
|
||||||
|
@ -453,7 +449,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn udp_clone_two_read() {
|
fn udp_clone_two_read() {
|
||||||
each_ip(&mut |addr1, addr2| {
|
each_ip(&mut |addr1, addr2| {
|
||||||
let sock1 = t!(UdpSocket::bind(&addr1));
|
let sock1 = t!(UdpSocket::bind(&addr1));
|
||||||
|
@ -486,7 +481,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn udp_clone_two_write() {
|
fn udp_clone_two_write() {
|
||||||
each_ip(&mut |addr1, addr2| {
|
each_ip(&mut |addr1, addr2| {
|
||||||
let sock1 = t!(UdpSocket::bind(&addr1));
|
let sock1 = t!(UdpSocket::bind(&addr1));
|
||||||
|
@ -525,7 +519,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn debug() {
|
fn debug() {
|
||||||
let name = if cfg!(windows) {"socket"} else {"fd"};
|
let name = if cfg!(windows) {"socket"} else {"fd"};
|
||||||
let socket_addr = next_test_ip4();
|
let socket_addr = next_test_ip4();
|
||||||
|
@ -541,7 +534,6 @@ mod tests {
|
||||||
// no longer has rounding errors.
|
// no longer has rounding errors.
|
||||||
#[cfg_attr(any(target_os = "bitrig", target_os = "netbsd", target_os = "openbsd"), ignore)]
|
#[cfg_attr(any(target_os = "bitrig", target_os = "netbsd", target_os = "openbsd"), ignore)]
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn timeouts() {
|
fn timeouts() {
|
||||||
let addr = next_test_ip4();
|
let addr = next_test_ip4();
|
||||||
|
|
||||||
|
@ -566,7 +558,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn test_read_timeout() {
|
fn test_read_timeout() {
|
||||||
let addr = next_test_ip4();
|
let addr = next_test_ip4();
|
||||||
|
|
||||||
|
@ -582,7 +573,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn test_read_with_timeout() {
|
fn test_read_with_timeout() {
|
||||||
let addr = next_test_ip4();
|
let addr = next_test_ip4();
|
||||||
|
|
||||||
|
@ -602,7 +592,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn connect_send_recv() {
|
fn connect_send_recv() {
|
||||||
let addr = next_test_ip4();
|
let addr = next_test_ip4();
|
||||||
|
|
||||||
|
@ -617,7 +606,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn ttl() {
|
fn ttl() {
|
||||||
let ttl = 100;
|
let ttl = 100;
|
||||||
|
|
||||||
|
@ -630,7 +618,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn set_nonblocking() {
|
fn set_nonblocking() {
|
||||||
let addr = next_test_ip4();
|
let addr = next_test_ip4();
|
||||||
|
|
||||||
|
|
|
@ -807,7 +807,7 @@ pub fn exit(code: i32) -> ! {
|
||||||
::sys::os::exit(code)
|
::sys::os::exit(code)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(all(test, not(target_os = "emscripten")))]
|
||||||
mod tests {
|
mod tests {
|
||||||
use io::prelude::*;
|
use io::prelude::*;
|
||||||
|
|
||||||
|
@ -819,7 +819,6 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "android", ignore)]
|
#[cfg_attr(target_os = "android", ignore)]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn smoke() {
|
fn smoke() {
|
||||||
let p = Command::new("true").spawn();
|
let p = Command::new("true").spawn();
|
||||||
assert!(p.is_ok());
|
assert!(p.is_ok());
|
||||||
|
@ -838,7 +837,6 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "android", ignore)]
|
#[cfg_attr(target_os = "android", ignore)]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn exit_reported_right() {
|
fn exit_reported_right() {
|
||||||
let p = Command::new("false").spawn();
|
let p = Command::new("false").spawn();
|
||||||
assert!(p.is_ok());
|
assert!(p.is_ok());
|
||||||
|
@ -850,7 +848,6 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
#[cfg_attr(target_os = "android", ignore)]
|
#[cfg_attr(target_os = "android", ignore)]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn signal_reported_right() {
|
fn signal_reported_right() {
|
||||||
use os::unix::process::ExitStatusExt;
|
use os::unix::process::ExitStatusExt;
|
||||||
|
|
||||||
|
@ -879,7 +876,6 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "android", ignore)]
|
#[cfg_attr(target_os = "android", ignore)]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn stdout_works() {
|
fn stdout_works() {
|
||||||
let mut cmd = Command::new("echo");
|
let mut cmd = Command::new("echo");
|
||||||
cmd.arg("foobar").stdout(Stdio::piped());
|
cmd.arg("foobar").stdout(Stdio::piped());
|
||||||
|
@ -888,7 +884,6 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(any(windows, target_os = "android"), ignore)]
|
#[cfg_attr(any(windows, target_os = "android"), ignore)]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn set_current_dir_works() {
|
fn set_current_dir_works() {
|
||||||
let mut cmd = Command::new("/bin/sh");
|
let mut cmd = Command::new("/bin/sh");
|
||||||
cmd.arg("-c").arg("pwd")
|
cmd.arg("-c").arg("pwd")
|
||||||
|
@ -899,7 +894,6 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(any(windows, target_os = "android"), ignore)]
|
#[cfg_attr(any(windows, target_os = "android"), ignore)]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn stdin_works() {
|
fn stdin_works() {
|
||||||
let mut p = Command::new("/bin/sh")
|
let mut p = Command::new("/bin/sh")
|
||||||
.arg("-c").arg("read line; echo $line")
|
.arg("-c").arg("read line; echo $line")
|
||||||
|
@ -918,7 +912,6 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "android", ignore)]
|
#[cfg_attr(target_os = "android", ignore)]
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn uid_works() {
|
fn uid_works() {
|
||||||
use os::unix::prelude::*;
|
use os::unix::prelude::*;
|
||||||
use libc;
|
use libc;
|
||||||
|
@ -945,7 +938,6 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "android", ignore)]
|
#[cfg_attr(target_os = "android", ignore)]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn test_process_status() {
|
fn test_process_status() {
|
||||||
let mut status = Command::new("false").status().unwrap();
|
let mut status = Command::new("false").status().unwrap();
|
||||||
assert!(status.code() == Some(1));
|
assert!(status.code() == Some(1));
|
||||||
|
@ -955,7 +947,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn test_process_output_fail_to_start() {
|
fn test_process_output_fail_to_start() {
|
||||||
match Command::new("/no-binary-by-this-name-should-exist").output() {
|
match Command::new("/no-binary-by-this-name-should-exist").output() {
|
||||||
Err(e) => assert_eq!(e.kind(), ErrorKind::NotFound),
|
Err(e) => assert_eq!(e.kind(), ErrorKind::NotFound),
|
||||||
|
@ -965,7 +956,6 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "android", ignore)]
|
#[cfg_attr(target_os = "android", ignore)]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn test_process_output_output() {
|
fn test_process_output_output() {
|
||||||
let Output {status, stdout, stderr}
|
let Output {status, stdout, stderr}
|
||||||
= Command::new("echo").arg("hello").output().unwrap();
|
= Command::new("echo").arg("hello").output().unwrap();
|
||||||
|
@ -978,7 +968,6 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "android", ignore)]
|
#[cfg_attr(target_os = "android", ignore)]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn test_process_output_error() {
|
fn test_process_output_error() {
|
||||||
let Output {status, stdout, stderr}
|
let Output {status, stdout, stderr}
|
||||||
= Command::new("mkdir").arg(".").output().unwrap();
|
= Command::new("mkdir").arg(".").output().unwrap();
|
||||||
|
@ -990,7 +979,6 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "android", ignore)]
|
#[cfg_attr(target_os = "android", ignore)]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn test_finish_once() {
|
fn test_finish_once() {
|
||||||
let mut prog = Command::new("false").spawn().unwrap();
|
let mut prog = Command::new("false").spawn().unwrap();
|
||||||
assert!(prog.wait().unwrap().code() == Some(1));
|
assert!(prog.wait().unwrap().code() == Some(1));
|
||||||
|
@ -998,7 +986,6 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "android", ignore)]
|
#[cfg_attr(target_os = "android", ignore)]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn test_finish_twice() {
|
fn test_finish_twice() {
|
||||||
let mut prog = Command::new("false").spawn().unwrap();
|
let mut prog = Command::new("false").spawn().unwrap();
|
||||||
assert!(prog.wait().unwrap().code() == Some(1));
|
assert!(prog.wait().unwrap().code() == Some(1));
|
||||||
|
@ -1007,7 +994,6 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "android", ignore)]
|
#[cfg_attr(target_os = "android", ignore)]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn test_wait_with_output_once() {
|
fn test_wait_with_output_once() {
|
||||||
let prog = Command::new("echo").arg("hello").stdout(Stdio::piped())
|
let prog = Command::new("echo").arg("hello").stdout(Stdio::piped())
|
||||||
.spawn().unwrap();
|
.spawn().unwrap();
|
||||||
|
@ -1038,7 +1024,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn test_inherit_env() {
|
fn test_inherit_env() {
|
||||||
use env;
|
use env;
|
||||||
|
|
||||||
|
@ -1064,7 +1049,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn test_override_env() {
|
fn test_override_env() {
|
||||||
use env;
|
use env;
|
||||||
|
|
||||||
|
@ -1085,7 +1069,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn test_add_to_env() {
|
fn test_add_to_env() {
|
||||||
let result = env_cmd().env("RUN_TEST_NEW_ENV", "123").output().unwrap();
|
let result = env_cmd().env("RUN_TEST_NEW_ENV", "123").output().unwrap();
|
||||||
let output = String::from_utf8_lossy(&result.stdout).to_string();
|
let output = String::from_utf8_lossy(&result.stdout).to_string();
|
||||||
|
|
|
@ -1268,7 +1268,7 @@ impl error::Error for TryRecvError {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(all(test, not(target_os = "emscripten")))]
|
||||||
mod tests {
|
mod tests {
|
||||||
use env;
|
use env;
|
||||||
use super::*;
|
use super::*;
|
||||||
|
@ -1314,7 +1314,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn smoke_threads() {
|
fn smoke_threads() {
|
||||||
let (tx, rx) = channel::<i32>();
|
let (tx, rx) = channel::<i32>();
|
||||||
let _t = thread::spawn(move|| {
|
let _t = thread::spawn(move|| {
|
||||||
|
@ -1347,7 +1346,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn port_gone_concurrent() {
|
fn port_gone_concurrent() {
|
||||||
let (tx, rx) = channel::<i32>();
|
let (tx, rx) = channel::<i32>();
|
||||||
let _t = thread::spawn(move|| {
|
let _t = thread::spawn(move|| {
|
||||||
|
@ -1357,7 +1355,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn port_gone_concurrent_shared() {
|
fn port_gone_concurrent_shared() {
|
||||||
let (tx, rx) = channel::<i32>();
|
let (tx, rx) = channel::<i32>();
|
||||||
let tx2 = tx.clone();
|
let tx2 = tx.clone();
|
||||||
|
@ -1384,7 +1381,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn chan_gone_concurrent() {
|
fn chan_gone_concurrent() {
|
||||||
let (tx, rx) = channel::<i32>();
|
let (tx, rx) = channel::<i32>();
|
||||||
let _t = thread::spawn(move|| {
|
let _t = thread::spawn(move|| {
|
||||||
|
@ -1395,7 +1391,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn stress() {
|
fn stress() {
|
||||||
let (tx, rx) = channel::<i32>();
|
let (tx, rx) = channel::<i32>();
|
||||||
let t = thread::spawn(move|| {
|
let t = thread::spawn(move|| {
|
||||||
|
@ -1408,7 +1403,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn stress_shared() {
|
fn stress_shared() {
|
||||||
const AMT: u32 = 10000;
|
const AMT: u32 = 10000;
|
||||||
const NTHREADS: u32 = 8;
|
const NTHREADS: u32 = 8;
|
||||||
|
@ -1435,7 +1429,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn send_from_outside_runtime() {
|
fn send_from_outside_runtime() {
|
||||||
let (tx1, rx1) = channel::<()>();
|
let (tx1, rx1) = channel::<()>();
|
||||||
let (tx2, rx2) = channel::<i32>();
|
let (tx2, rx2) = channel::<i32>();
|
||||||
|
@ -1456,7 +1449,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn recv_from_outside_runtime() {
|
fn recv_from_outside_runtime() {
|
||||||
let (tx, rx) = channel::<i32>();
|
let (tx, rx) = channel::<i32>();
|
||||||
let t = thread::spawn(move|| {
|
let t = thread::spawn(move|| {
|
||||||
|
@ -1471,7 +1463,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn no_runtime() {
|
fn no_runtime() {
|
||||||
let (tx1, rx1) = channel::<i32>();
|
let (tx1, rx1) = channel::<i32>();
|
||||||
let (tx2, rx2) = channel::<i32>();
|
let (tx2, rx2) = channel::<i32>();
|
||||||
|
@ -1510,7 +1501,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn oneshot_single_thread_recv_chan_close() {
|
fn oneshot_single_thread_recv_chan_close() {
|
||||||
// Receiving on a closed chan will panic
|
// Receiving on a closed chan will panic
|
||||||
let res = thread::spawn(move|| {
|
let res = thread::spawn(move|| {
|
||||||
|
@ -1580,7 +1570,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn oneshot_multi_task_recv_then_send() {
|
fn oneshot_multi_task_recv_then_send() {
|
||||||
let (tx, rx) = channel::<Box<i32>>();
|
let (tx, rx) = channel::<Box<i32>>();
|
||||||
let _t = thread::spawn(move|| {
|
let _t = thread::spawn(move|| {
|
||||||
|
@ -1591,7 +1580,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn oneshot_multi_task_recv_then_close() {
|
fn oneshot_multi_task_recv_then_close() {
|
||||||
let (tx, rx) = channel::<Box<i32>>();
|
let (tx, rx) = channel::<Box<i32>>();
|
||||||
let _t = thread::spawn(move|| {
|
let _t = thread::spawn(move|| {
|
||||||
|
@ -1604,7 +1592,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn oneshot_multi_thread_close_stress() {
|
fn oneshot_multi_thread_close_stress() {
|
||||||
for _ in 0..stress_factor() {
|
for _ in 0..stress_factor() {
|
||||||
let (tx, rx) = channel::<i32>();
|
let (tx, rx) = channel::<i32>();
|
||||||
|
@ -1616,7 +1603,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn oneshot_multi_thread_send_close_stress() {
|
fn oneshot_multi_thread_send_close_stress() {
|
||||||
for _ in 0..stress_factor() {
|
for _ in 0..stress_factor() {
|
||||||
let (tx, rx) = channel::<i32>();
|
let (tx, rx) = channel::<i32>();
|
||||||
|
@ -1630,7 +1616,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn oneshot_multi_thread_recv_close_stress() {
|
fn oneshot_multi_thread_recv_close_stress() {
|
||||||
for _ in 0..stress_factor() {
|
for _ in 0..stress_factor() {
|
||||||
let (tx, rx) = channel::<i32>();
|
let (tx, rx) = channel::<i32>();
|
||||||
|
@ -1649,7 +1634,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn oneshot_multi_thread_send_recv_stress() {
|
fn oneshot_multi_thread_send_recv_stress() {
|
||||||
for _ in 0..stress_factor() {
|
for _ in 0..stress_factor() {
|
||||||
let (tx, rx) = channel::<Box<isize>>();
|
let (tx, rx) = channel::<Box<isize>>();
|
||||||
|
@ -1661,7 +1645,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn stream_send_recv_stress() {
|
fn stream_send_recv_stress() {
|
||||||
for _ in 0..stress_factor() {
|
for _ in 0..stress_factor() {
|
||||||
let (tx, rx) = channel();
|
let (tx, rx) = channel();
|
||||||
|
@ -1700,7 +1683,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn stress_recv_timeout_two_threads() {
|
fn stress_recv_timeout_two_threads() {
|
||||||
let (tx, rx) = channel();
|
let (tx, rx) = channel();
|
||||||
let stress = stress_factor() + 100;
|
let stress = stress_factor() + 100;
|
||||||
|
@ -1742,7 +1724,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn stress_recv_timeout_shared() {
|
fn stress_recv_timeout_shared() {
|
||||||
let (tx, rx) = channel();
|
let (tx, rx) = channel();
|
||||||
let stress = stress_factor() + 100;
|
let stress = stress_factor() + 100;
|
||||||
|
@ -1781,7 +1762,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn shared_recv_timeout() {
|
fn shared_recv_timeout() {
|
||||||
let (tx, rx) = channel();
|
let (tx, rx) = channel();
|
||||||
let total = 5;
|
let total = 5;
|
||||||
|
@ -1800,7 +1780,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn shared_chan_stress() {
|
fn shared_chan_stress() {
|
||||||
let (tx, rx) = channel();
|
let (tx, rx) = channel();
|
||||||
let total = stress_factor() + 100;
|
let total = stress_factor() + 100;
|
||||||
|
@ -1817,7 +1796,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn test_nested_recv_iter() {
|
fn test_nested_recv_iter() {
|
||||||
let (tx, rx) = channel::<i32>();
|
let (tx, rx) = channel::<i32>();
|
||||||
let (total_tx, total_rx) = channel::<i32>();
|
let (total_tx, total_rx) = channel::<i32>();
|
||||||
|
@ -1838,7 +1816,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn test_recv_iter_break() {
|
fn test_recv_iter_break() {
|
||||||
let (tx, rx) = channel::<i32>();
|
let (tx, rx) = channel::<i32>();
|
||||||
let (count_tx, count_rx) = channel();
|
let (count_tx, count_rx) = channel();
|
||||||
|
@ -1864,7 +1841,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn test_recv_try_iter() {
|
fn test_recv_try_iter() {
|
||||||
let (request_tx, request_rx) = channel();
|
let (request_tx, request_rx) = channel();
|
||||||
let (response_tx, response_rx) = channel();
|
let (response_tx, response_rx) = channel();
|
||||||
|
@ -1919,7 +1895,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn try_recv_states() {
|
fn try_recv_states() {
|
||||||
let (tx1, rx1) = channel::<i32>();
|
let (tx1, rx1) = channel::<i32>();
|
||||||
let (tx2, rx2) = channel::<()>();
|
let (tx2, rx2) = channel::<()>();
|
||||||
|
@ -1946,7 +1921,6 @@ mod tests {
|
||||||
// This bug used to end up in a livelock inside of the Receiver destructor
|
// This bug used to end up in a livelock inside of the Receiver destructor
|
||||||
// because the internal state of the Shared packet was corrupted
|
// because the internal state of the Shared packet was corrupted
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn destroy_upgraded_shared_port_when_sender_still_active() {
|
fn destroy_upgraded_shared_port_when_sender_still_active() {
|
||||||
let (tx, rx) = channel();
|
let (tx, rx) = channel();
|
||||||
let (tx2, rx2) = channel();
|
let (tx2, rx2) = channel();
|
||||||
|
@ -1968,7 +1942,7 @@ mod tests {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(all(test, not(target_os = "emscripten")))]
|
||||||
mod sync_tests {
|
mod sync_tests {
|
||||||
use env;
|
use env;
|
||||||
use thread;
|
use thread;
|
||||||
|
@ -2014,7 +1988,6 @@ mod sync_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn smoke_threads() {
|
fn smoke_threads() {
|
||||||
let (tx, rx) = sync_channel::<i32>(0);
|
let (tx, rx) = sync_channel::<i32>(0);
|
||||||
let _t = thread::spawn(move|| {
|
let _t = thread::spawn(move|| {
|
||||||
|
@ -2040,7 +2013,6 @@ mod sync_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn port_gone_concurrent() {
|
fn port_gone_concurrent() {
|
||||||
let (tx, rx) = sync_channel::<i32>(0);
|
let (tx, rx) = sync_channel::<i32>(0);
|
||||||
let _t = thread::spawn(move|| {
|
let _t = thread::spawn(move|| {
|
||||||
|
@ -2050,7 +2022,6 @@ mod sync_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn port_gone_concurrent_shared() {
|
fn port_gone_concurrent_shared() {
|
||||||
let (tx, rx) = sync_channel::<i32>(0);
|
let (tx, rx) = sync_channel::<i32>(0);
|
||||||
let tx2 = tx.clone();
|
let tx2 = tx.clone();
|
||||||
|
@ -2077,7 +2048,6 @@ mod sync_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn chan_gone_concurrent() {
|
fn chan_gone_concurrent() {
|
||||||
let (tx, rx) = sync_channel::<i32>(0);
|
let (tx, rx) = sync_channel::<i32>(0);
|
||||||
thread::spawn(move|| {
|
thread::spawn(move|| {
|
||||||
|
@ -2088,7 +2058,6 @@ mod sync_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn stress() {
|
fn stress() {
|
||||||
let (tx, rx) = sync_channel::<i32>(0);
|
let (tx, rx) = sync_channel::<i32>(0);
|
||||||
thread::spawn(move|| {
|
thread::spawn(move|| {
|
||||||
|
@ -2100,7 +2069,6 @@ mod sync_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn stress_recv_timeout_two_threads() {
|
fn stress_recv_timeout_two_threads() {
|
||||||
let (tx, rx) = sync_channel::<i32>(0);
|
let (tx, rx) = sync_channel::<i32>(0);
|
||||||
|
|
||||||
|
@ -2124,7 +2092,6 @@ mod sync_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn stress_recv_timeout_shared() {
|
fn stress_recv_timeout_shared() {
|
||||||
const AMT: u32 = 1000;
|
const AMT: u32 = 1000;
|
||||||
const NTHREADS: u32 = 8;
|
const NTHREADS: u32 = 8;
|
||||||
|
@ -2163,7 +2130,6 @@ mod sync_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn stress_shared() {
|
fn stress_shared() {
|
||||||
const AMT: u32 = 1000;
|
const AMT: u32 = 1000;
|
||||||
const NTHREADS: u32 = 8;
|
const NTHREADS: u32 = 8;
|
||||||
|
@ -2214,7 +2180,6 @@ mod sync_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn oneshot_single_thread_recv_chan_close() {
|
fn oneshot_single_thread_recv_chan_close() {
|
||||||
// Receiving on a closed chan will panic
|
// Receiving on a closed chan will panic
|
||||||
let res = thread::spawn(move|| {
|
let res = thread::spawn(move|| {
|
||||||
|
@ -2299,7 +2264,6 @@ mod sync_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn oneshot_multi_task_recv_then_send() {
|
fn oneshot_multi_task_recv_then_send() {
|
||||||
let (tx, rx) = sync_channel::<Box<i32>>(0);
|
let (tx, rx) = sync_channel::<Box<i32>>(0);
|
||||||
let _t = thread::spawn(move|| {
|
let _t = thread::spawn(move|| {
|
||||||
|
@ -2310,7 +2274,6 @@ mod sync_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn oneshot_multi_task_recv_then_close() {
|
fn oneshot_multi_task_recv_then_close() {
|
||||||
let (tx, rx) = sync_channel::<Box<i32>>(0);
|
let (tx, rx) = sync_channel::<Box<i32>>(0);
|
||||||
let _t = thread::spawn(move|| {
|
let _t = thread::spawn(move|| {
|
||||||
|
@ -2323,7 +2286,6 @@ mod sync_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn oneshot_multi_thread_close_stress() {
|
fn oneshot_multi_thread_close_stress() {
|
||||||
for _ in 0..stress_factor() {
|
for _ in 0..stress_factor() {
|
||||||
let (tx, rx) = sync_channel::<i32>(0);
|
let (tx, rx) = sync_channel::<i32>(0);
|
||||||
|
@ -2335,7 +2297,6 @@ mod sync_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn oneshot_multi_thread_send_close_stress() {
|
fn oneshot_multi_thread_send_close_stress() {
|
||||||
for _ in 0..stress_factor() {
|
for _ in 0..stress_factor() {
|
||||||
let (tx, rx) = sync_channel::<i32>(0);
|
let (tx, rx) = sync_channel::<i32>(0);
|
||||||
|
@ -2349,7 +2310,6 @@ mod sync_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn oneshot_multi_thread_recv_close_stress() {
|
fn oneshot_multi_thread_recv_close_stress() {
|
||||||
for _ in 0..stress_factor() {
|
for _ in 0..stress_factor() {
|
||||||
let (tx, rx) = sync_channel::<i32>(0);
|
let (tx, rx) = sync_channel::<i32>(0);
|
||||||
|
@ -2368,7 +2328,6 @@ mod sync_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn oneshot_multi_thread_send_recv_stress() {
|
fn oneshot_multi_thread_send_recv_stress() {
|
||||||
for _ in 0..stress_factor() {
|
for _ in 0..stress_factor() {
|
||||||
let (tx, rx) = sync_channel::<Box<i32>>(0);
|
let (tx, rx) = sync_channel::<Box<i32>>(0);
|
||||||
|
@ -2380,7 +2339,6 @@ mod sync_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn stream_send_recv_stress() {
|
fn stream_send_recv_stress() {
|
||||||
for _ in 0..stress_factor() {
|
for _ in 0..stress_factor() {
|
||||||
let (tx, rx) = sync_channel::<Box<i32>>(0);
|
let (tx, rx) = sync_channel::<Box<i32>>(0);
|
||||||
|
@ -2417,7 +2375,6 @@ mod sync_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn shared_chan_stress() {
|
fn shared_chan_stress() {
|
||||||
let (tx, rx) = sync_channel(0);
|
let (tx, rx) = sync_channel(0);
|
||||||
let total = stress_factor() + 100;
|
let total = stress_factor() + 100;
|
||||||
|
@ -2434,7 +2391,6 @@ mod sync_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn test_nested_recv_iter() {
|
fn test_nested_recv_iter() {
|
||||||
let (tx, rx) = sync_channel::<i32>(0);
|
let (tx, rx) = sync_channel::<i32>(0);
|
||||||
let (total_tx, total_rx) = sync_channel::<i32>(0);
|
let (total_tx, total_rx) = sync_channel::<i32>(0);
|
||||||
|
@ -2455,7 +2411,6 @@ mod sync_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn test_recv_iter_break() {
|
fn test_recv_iter_break() {
|
||||||
let (tx, rx) = sync_channel::<i32>(0);
|
let (tx, rx) = sync_channel::<i32>(0);
|
||||||
let (count_tx, count_rx) = sync_channel(0);
|
let (count_tx, count_rx) = sync_channel(0);
|
||||||
|
@ -2481,7 +2436,6 @@ mod sync_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn try_recv_states() {
|
fn try_recv_states() {
|
||||||
let (tx1, rx1) = sync_channel::<i32>(1);
|
let (tx1, rx1) = sync_channel::<i32>(1);
|
||||||
let (tx2, rx2) = sync_channel::<()>(1);
|
let (tx2, rx2) = sync_channel::<()>(1);
|
||||||
|
@ -2508,7 +2462,6 @@ mod sync_tests {
|
||||||
// This bug used to end up in a livelock inside of the Receiver destructor
|
// This bug used to end up in a livelock inside of the Receiver destructor
|
||||||
// because the internal state of the Shared packet was corrupted
|
// because the internal state of the Shared packet was corrupted
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn destroy_upgraded_shared_port_when_sender_still_active() {
|
fn destroy_upgraded_shared_port_when_sender_still_active() {
|
||||||
let (tx, rx) = sync_channel::<()>(0);
|
let (tx, rx) = sync_channel::<()>(0);
|
||||||
let (tx2, rx2) = sync_channel::<()>(0);
|
let (tx2, rx2) = sync_channel::<()>(0);
|
||||||
|
@ -2530,7 +2483,6 @@ mod sync_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn send1() {
|
fn send1() {
|
||||||
let (tx, rx) = sync_channel::<i32>(0);
|
let (tx, rx) = sync_channel::<i32>(0);
|
||||||
let _t = thread::spawn(move|| { rx.recv().unwrap(); });
|
let _t = thread::spawn(move|| { rx.recv().unwrap(); });
|
||||||
|
@ -2538,7 +2490,6 @@ mod sync_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn send2() {
|
fn send2() {
|
||||||
let (tx, rx) = sync_channel::<i32>(0);
|
let (tx, rx) = sync_channel::<i32>(0);
|
||||||
let _t = thread::spawn(move|| { drop(rx); });
|
let _t = thread::spawn(move|| { drop(rx); });
|
||||||
|
@ -2546,7 +2497,6 @@ mod sync_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn send3() {
|
fn send3() {
|
||||||
let (tx, rx) = sync_channel::<i32>(1);
|
let (tx, rx) = sync_channel::<i32>(1);
|
||||||
assert_eq!(tx.send(1), Ok(()));
|
assert_eq!(tx.send(1), Ok(()));
|
||||||
|
@ -2555,7 +2505,6 @@ mod sync_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn send4() {
|
fn send4() {
|
||||||
let (tx, rx) = sync_channel::<i32>(0);
|
let (tx, rx) = sync_channel::<i32>(0);
|
||||||
let tx2 = tx.clone();
|
let tx2 = tx.clone();
|
||||||
|
@ -2596,7 +2545,6 @@ mod sync_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn issue_15761() {
|
fn issue_15761() {
|
||||||
fn repro() {
|
fn repro() {
|
||||||
let (tx1, rx1) = sync_channel::<()>(3);
|
let (tx1, rx1) = sync_channel::<()>(3);
|
||||||
|
|
|
@ -366,7 +366,7 @@ impl<'rx, T:Send+'rx> fmt::Debug for Handle<'rx, T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(all(test, not(target_os = "emscripten")))]
|
||||||
#[allow(unused_imports)]
|
#[allow(unused_imports)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use thread;
|
use thread;
|
||||||
|
@ -444,7 +444,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn unblocks() {
|
fn unblocks() {
|
||||||
let (tx1, rx1) = channel::<i32>();
|
let (tx1, rx1) = channel::<i32>();
|
||||||
let (_tx2, rx2) = channel::<i32>();
|
let (_tx2, rx2) = channel::<i32>();
|
||||||
|
@ -469,7 +468,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn both_ready() {
|
fn both_ready() {
|
||||||
let (tx1, rx1) = channel::<i32>();
|
let (tx1, rx1) = channel::<i32>();
|
||||||
let (tx2, rx2) = channel::<i32>();
|
let (tx2, rx2) = channel::<i32>();
|
||||||
|
@ -496,7 +494,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn stress() {
|
fn stress() {
|
||||||
const AMT: i32 = 10000;
|
const AMT: i32 = 10000;
|
||||||
let (tx1, rx1) = channel::<i32>();
|
let (tx1, rx1) = channel::<i32>();
|
||||||
|
@ -524,7 +521,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn cloning() {
|
fn cloning() {
|
||||||
let (tx1, rx1) = channel::<i32>();
|
let (tx1, rx1) = channel::<i32>();
|
||||||
let (_tx2, rx2) = channel::<i32>();
|
let (_tx2, rx2) = channel::<i32>();
|
||||||
|
@ -547,7 +543,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn cloning2() {
|
fn cloning2() {
|
||||||
let (tx1, rx1) = channel::<i32>();
|
let (tx1, rx1) = channel::<i32>();
|
||||||
let (_tx2, rx2) = channel::<i32>();
|
let (_tx2, rx2) = channel::<i32>();
|
||||||
|
@ -570,7 +565,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn cloning3() {
|
fn cloning3() {
|
||||||
let (tx1, rx1) = channel::<()>();
|
let (tx1, rx1) = channel::<()>();
|
||||||
let (tx2, rx2) = channel::<()>();
|
let (tx2, rx2) = channel::<()>();
|
||||||
|
@ -688,7 +682,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn oneshot_data_waiting() {
|
fn oneshot_data_waiting() {
|
||||||
let (tx1, rx1) = channel();
|
let (tx1, rx1) = channel();
|
||||||
let (tx2, rx2) = channel();
|
let (tx2, rx2) = channel();
|
||||||
|
@ -705,7 +698,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn stream_data_waiting() {
|
fn stream_data_waiting() {
|
||||||
let (tx1, rx1) = channel();
|
let (tx1, rx1) = channel();
|
||||||
let (tx2, rx2) = channel();
|
let (tx2, rx2) = channel();
|
||||||
|
@ -726,7 +718,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn shared_data_waiting() {
|
fn shared_data_waiting() {
|
||||||
let (tx1, rx1) = channel();
|
let (tx1, rx1) = channel();
|
||||||
let (tx2, rx2) = channel();
|
let (tx2, rx2) = channel();
|
||||||
|
@ -755,7 +746,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn sync2() {
|
fn sync2() {
|
||||||
let (tx, rx) = sync_channel::<i32>(0);
|
let (tx, rx) = sync_channel::<i32>(0);
|
||||||
let _t = thread::spawn(move|| {
|
let _t = thread::spawn(move|| {
|
||||||
|
@ -768,7 +758,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
|
||||||
fn sync3() {
|
fn sync3() {
|
||||||
let (tx1, rx1) = sync_channel::<i32>(0);
|
let (tx1, rx1) = sync_channel::<i32>(0);
|
||||||
let (tx2, rx2): (Sender<i32>, Receiver<i32>) = channel();
|
let (tx2, rx2): (Sender<i32>, Receiver<i32>) = channel();
|
||||||
|
|
Loading…
Add table
Reference in a new issue