docs.rs failed to build tokio-async-await-test-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Tokio Async/Await Test
This is a simple crate that provides a procedural macro similar to #[test]
that will run the test as a single future on a tokio runtime.
Usage
First, you must be on nightly rust as of 12-02-2018
. Add the crate to your Cargo.toml
.
[]
= { = "https://github.com/LucioFranco/tokio-async-await-test" }
This will give you the crate but you will also need to make sure that you also have futures-preview
and tokio
as dependencies like so.
= { = "0.1", = ["async-await-preview"] }
= { = "0.3.0-alpha.10", = ["tokio-compat"] }
Once, you have all these dependencies you can then use the attribute like so.
extern crate futures;
extern crate tokio;
extern crate tokio_async_await_test;
use async_test;
async
This will spin up a tokio runtime and block on the basic
function. This generally expands to look like this. Where fut
is the test future you are running.
You can also use a current thread runtime by importing use tokio_async_await_test::async_current_thread_test;
.