diff options
author | Taiki Endo <te316e89@gmail.com> | 2019-11-01 13:09:32 +0900 |
---|---|---|
committer | Carl Lerche <me@carllerche.com> | 2019-10-31 21:09:32 -0700 |
commit | 02f7264008e0333d7c4df183d3bcfbda8a6d930f (patch) | |
tree | 6100ae0b9a96178970d9e9a73e3225134a5b38a8 /tests-build/tests/features.rs | |
parent | 2902e39db0151c9064be535b7983748eb9a0d92f (diff) |
chore: check each feature works properly (#1695)
It is hard to maintain features list manually, so use cargo-hack's
`--each-feature` flag. And cargo-hack provides a workaround for an issue
that dev-dependencies leaking into normal build (`--no-dev-deps` flag),
so removed own ci tool.
Also, compared to running tests on all features, there is not much
advantage in running tests on each feature, so only the default features
and all features are tested.
If the behavior changes depending on the feature, we need to test it as
another job in CI.
Diffstat (limited to 'tests-build/tests/features.rs')
-rw-r--r-- | tests-build/tests/features.rs | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/tests-build/tests/features.rs b/tests-build/tests/features.rs deleted file mode 100644 index b40e44ed..00000000 --- a/tests-build/tests/features.rs +++ /dev/null @@ -1,62 +0,0 @@ -#![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); -} |