mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-02 00:00:11 +02:00
chore: rename ui-tests -> build-tests (#1460)
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
[package]
|
||||
name = "build-tests"
|
||||
version = "0.1.0"
|
||||
authors = ["Tokio Contributors <[email protected]>"]
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[features]
|
||||
executor-without-current-thread = ["tokio-executor"]
|
||||
net-no-features = ["tokio-net"]
|
||||
net-with-tcp = ["tokio-net/tcp"]
|
||||
net-with-udp = ["tokio-net/udp"]
|
||||
tokio-no-features = ["tokio"]
|
||||
tokio-with-net = ["tokio/net"]
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
tokio-executor = { path = "../tokio-executor", optional = true }
|
||||
tokio-net = { path = "../tokio-net", optional = true }
|
||||
tokio = { path = "../tokio", optional = true, default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
trybuild = "1.0"
|
||||
@@ -0,0 +1,2 @@
|
||||
Tests the various combination of feature flags. This is broken out to a separate
|
||||
crate to work around limitations with cargo features.
|
||||
@@ -0,0 +1,8 @@
|
||||
#[cfg(feature = "tokio-executor")]
|
||||
pub use tokio_executor;
|
||||
|
||||
#[cfg(feature = "tokio-net")]
|
||||
pub use tokio_net;
|
||||
|
||||
#[cfg(feature = "tokio")]
|
||||
pub use tokio;
|
||||
@@ -0,0 +1,3 @@
|
||||
use build_tests::tokio_executor::current_thread;
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,7 @@
|
||||
error[E0432]: unresolved import `build_tests::tokio_executor::current_thread`
|
||||
--> $DIR/executor_without_current_thread.rs:1:5
|
||||
|
|
||||
1 | use build_tests::tokio_executor::current_thread;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `current_thread` in `tokio_executor`
|
||||
|
||||
For more information about this error, try `rustc --explain E0432`.
|
||||
@@ -0,0 +1,4 @@
|
||||
use build_tests::tokio_net::tcp;
|
||||
|
||||
fn main() {}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
error[E0432]: unresolved import `build_tests::tokio_net::tcp`
|
||||
--> $DIR/net_without_tcp_missing_tcp.rs:1:5
|
||||
|
|
||||
1 | use build_tests::tokio_net::tcp;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `tcp` in `tokio_net`
|
||||
|
||||
For more information about this error, try `rustc --explain E0432`.
|
||||
@@ -0,0 +1,4 @@
|
||||
use build_tests::tokio_net::udp;
|
||||
|
||||
fn main() {}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
error[E0432]: unresolved import `build_tests::tokio_net::udp`
|
||||
--> $DIR/net_without_udp_missing_udp.rs:1:5
|
||||
|
|
||||
1 | use build_tests::tokio_net::udp;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `udp` in `tokio_net`
|
||||
|
||||
For more information about this error, try `rustc --explain E0432`.
|
||||
@@ -0,0 +1,3 @@
|
||||
use build_tests::tokio::net;
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,7 @@
|
||||
error[E0432]: unresolved import `build_tests::tokio::net`
|
||||
--> $DIR/tokio_without_net_missing_net.rs:1:5
|
||||
|
|
||||
1 | use build_tests::tokio::net;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ no `net` in `tokio`
|
||||
|
||||
For more information about this error, try `rustc --explain E0432`.
|
||||
@@ -0,0 +1,45 @@
|
||||
#![allow(unused_imports)]
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "tokio-net")]
|
||||
fn net_default() {
|
||||
use build_tests::tokio_net::driver::{set_default, Handle, Reactor, Registration};
|
||||
use build_tests::tokio_net::util::PollEvented;
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "net-with-tcp")]
|
||||
fn net_with_tcp() {
|
||||
use build_tests::tokio_net::tcp;
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "net-with-udp")]
|
||||
fn net_with_udp() {
|
||||
use build_tests::tokio_net::udp;
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "tokio-with-net")]
|
||||
fn tokio_with_net() {
|
||||
// net is present
|
||||
use build_tests::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 = "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");
|
||||
}
|
||||
|
||||
#[cfg(feature = "tokio-no-features")]
|
||||
t.compile_fail("tests/fail/tokio_without_net_missing_net.rs");
|
||||
|
||||
drop(t);
|
||||
}
|
||||
Reference in New Issue
Block a user