Files
tokio/tests-build/tests/features.rs
T

63 lines
1.4 KiB
Rust
Raw Normal View History

2019-08-15 20:37:25 -07:00
#![allow(unused_imports)]
#[test]
#[cfg(feature = "tokio-net")]
fn net_default() {
2019-10-25 12:50:15 -07:00
use tests_build::tokio_net::driver::{set_default, Handle, Reactor, Registration};
use tests_build::tokio_net::util::PollEvented;
2019-08-15 20:37:25 -07:00
}
#[test]
#[cfg(feature = "net-with-tcp")]
fn net_with_tcp() {
2019-10-25 12:50:15 -07:00
use tests_build::tokio_net::tcp;
2019-08-15 20:37:25 -07:00
}
2019-08-16 07:26:10 -07:00
#[test]
#[cfg(feature = "net-with-udp")]
fn net_with_udp() {
2019-10-25 12:50:15 -07:00
use tests_build::tokio_net::udp;
2019-08-16 07:26:10 -07:00
}
2019-08-16 14:42:05 -07:00
#[test]
#[cfg(feature = "net-with-uds")]
2019-09-24 02:47:39 +09:00
fn net_with_uds() {
2019-10-25 12:50:15 -07:00
use tests_build::tokio_net::uds;
2019-08-16 14:42:05 -07:00
}
2019-09-19 12:38:15 -07:00
#[test]
#[cfg(feature = "net-with-process")]
fn net_with_process() {
2019-10-25 12:50:15 -07:00
use tests_build::tokio_net::process;
2019-09-19 12:38:15 -07:00
}
#[test]
#[cfg(feature = "tokio-with-net")]
fn tokio_with_net() {
// net is present
2019-10-25 12:50:15 -07:00
use tests_build::tokio::net;
}
#[test]
fn compile_fail() {
let t = trybuild::TestCases::new();
#[cfg(feature = "executor-without-current-thread")]
t.compile_fail("tests/fail/executor_without_current_thread.rs");
#[cfg(feature = "macros-invalid-input")]
t.compile_fail("tests/fail/macros_invalid_input.rs");
2019-08-15 20:37:25 -07:00
#[cfg(feature = "net-no-features")]
2019-08-16 07:26:10 -07:00
{
t.compile_fail("tests/fail/net_without_tcp_missing_tcp.rs");
t.compile_fail("tests/fail/net_without_udp_missing_udp.rs");
2019-08-16 14:42:05 -07:00
t.compile_fail("tests/fail/net_without_uds_missing_uds.rs");
2019-08-16 07:26:10 -07:00
}
2019-08-15 20:37:25 -07:00
#[cfg(feature = "tokio-no-features")]
t.compile_fail("tests/fail/tokio_without_net_missing_net.rs");
drop(t);
}