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.
This commit is contained in:
Taiki Endo
2019-10-31 21:09:32 -07:00
committed by Carl Lerche
parent 2902e39db0
commit 02f7264008
23 changed files with 75 additions and 284 deletions
+12 -5
View File
@@ -36,19 +36,24 @@ default = [
"timer",
]
blocking = []
fs = ["blocking"]
executor-core = []
blocking = ["executor-core", "sync"]
fs = ["blocking", "io-traits"]
io-traits = ["bytes", "iovec"]
io-util = ["io-traits", "pin-project", "memchr"]
io = ["io-traits", "io-util"]
macros = ["tokio-macros"]
net-full = ["tcp", "udp", "uds"]
net-driver = ["mio", "blocking", "lazy_static"]
net-driver = ["io-traits", "mio", "blocking", "lazy_static"]
rt-current-thread = [
"executor-core",
"crossbeam-channel",
"timer",
"sync",
"net-driver",
]
rt-full = [
"executor-core",
"macros",
"num_cpus",
"net-full",
@@ -61,11 +66,13 @@ signal = [
"libc",
"mio-uds",
"net-driver",
"signal-hook-registry"
"signal-hook-registry",
"winapi/consoleapi",
"winapi/minwindef",
]
sync = ["fnv"]
tcp = ["io", "net-driver"]
timer = ["slab"]
timer = ["executor-core", "sync", "slab"]
udp = ["io", "net-driver"]
uds = ["io", "net-driver", "mio-uds", "libc"]
process = [
+1 -1
View File
@@ -18,10 +18,10 @@
mod scheduler;
use self::scheduler::{Scheduler, TickArgs};
use crate::executor::{EnterError, Executor, SpawnError, TypedExecutor};
#[cfg(feature = "blocking")]
use crate::executor::blocking::{Pool, PoolWaiter};
use crate::executor::park::{Park, ParkThread, Unpark};
use crate::executor::{EnterError, Executor, SpawnError, TypedExecutor};
use std::cell::Cell;
use std::error::Error;
+5 -2
View File
@@ -68,8 +68,11 @@ impl ThreadPool {
F: Future,
{
crate::executor::global::with_threadpool(self, || {
let mut enter = crate::executor::enter().expect("attempting to block while on a Tokio executor");
crate::executor::blocking::with_pool(self.spawner.blocking_pool(), || enter.block_on(future))
let mut enter =
crate::executor::enter().expect("attempting to block while on a Tokio executor");
crate::executor::blocking::with_pool(self.spawner.blocking_pool(), || {
enter.block_on(future)
})
})
}
+4 -2
View File
@@ -95,7 +95,7 @@ pub mod fs;
pub mod future;
#[cfg(feature = "io")]
#[cfg(feature = "io-traits")]
pub mod io;
#[cfg(feature = "net-driver")]
@@ -121,8 +121,10 @@ pub mod sync;
#[cfg(feature = "timer")]
pub mod timer;
#[cfg(feature = "executor-core")]
pub mod executor;
if_runtime! {
pub mod executor;
pub mod runtime;
#[doc(inline)]