diff options
author | Carl Lerche <me@carllerche.com> | 2019-10-25 12:50:15 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-25 12:50:15 -0700 |
commit | 227533d456fe32e48ffcd3796f1e6c8f9318b230 (patch) | |
tree | 498029aaf42dd64eeb8ef0e7d7f29802b45d4e95 /tests-build/tests/features.rs | |
parent | 03a9378297c73c2e56a6d6b55db22b92427b850a (diff) |
net: move into tokio crate (#1683)
A step towards collapsing Tokio sub crates into a single `tokio`
crate (#1318).
The `net` implementation is now provided by the main `tokio` crate.
Functionality can be opted out of by using the various net related
feature flags.
Diffstat (limited to 'tests-build/tests/features.rs')
-rw-r--r-- | tests-build/tests/features.rs | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/tests-build/tests/features.rs b/tests-build/tests/features.rs new file mode 100644 index 00000000..b40e44ed --- /dev/null +++ b/tests-build/tests/features.rs @@ -0,0 +1,62 @@ +#![allow(unused_imports)] + +#[test] +#[cfg(feature = "tokio-net")] +fn net_default() { + use tests_build::tokio_net::driver::{set_default, Handle, Reactor, Registration}; + use tests_build::tokio_net::util::PollEvented; +} + +#[test] +#[cfg(feature = "net-with-tcp")] +fn net_with_tcp() { + use tests_build::tokio_net::tcp; +} + +#[test] +#[cfg(feature = "net-with-udp")] +fn net_with_udp() { + use tests_build::tokio_net::udp; +} + +#[test] +#[cfg(feature = "net-with-uds")] +fn net_with_uds() { + use tests_build::tokio_net::uds; +} + +#[test] +#[cfg(feature = "net-with-process")] +fn net_with_process() { + use tests_build::tokio_net::process; +} + +#[test] +#[cfg(feature = "tokio-with-net")] +fn tokio_with_net() { + // net is present + 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"); + + #[cfg(feature = "net-no-features")] + { + t.compile_fail("tests/fail/net_without_tcp_missing_tcp.rs"); + t.compile_fail("tests/fail/net_without_udp_missing_udp.rs"); + t.compile_fail("tests/fail/net_without_uds_missing_uds.rs"); + } + + #[cfg(feature = "tokio-no-features")] + t.compile_fail("tests/fail/tokio_without_net_missing_net.rs"); + + drop(t); +} |