safina-async-test
An async_test
macro for running async fn
tests.
It is part of safina
, a safe async runtime.
Features
- Runs tests with
safina_executor
- Each test gets its own executor with 2 threads for async tasks and 1 thread for blocking tasks.
- Also calls
safina_timer::start_timer_thread
before running the test forbid(unsafe_code)
- Lightweight dependencies
- Straightforward implementation
Limitations
- Building on
stable
requiresonce_cell
crate which contains some unsafe code. This is necessary untilstd::lazy::OnceCell
is stable.
Examples
use async_test;
async
use async_test;
// Make your test an `async fn`.
async
Documentation
https://docs.rs/safina-async-test
Alternatives
Changelog
- v0.1.13 - Use
safina-executor
v0.3.1. - v0.1.12 - Use
safina-executor
v0.3.0. - v0.1.11 - Update docs.
- v0.1.10 - Use
safina-executor
v0.2.0. - v0.1.9 - Don't require users to also depend on
safina-executor
andsafina-timer
crates. - v0.1.8
- Support stable with rust 1.51 and
once_cell
. - Start an Executor for each test
- Support stable with rust 1.51 and
- v0.1.7 - Update to safina-executor v0.1.4
- v0.1.6 - Start
safina-timer
thread - v0.1.5 - Use
safina-executor
v0.1.3 API - v0.1.4 - Upgrade to new
safina-executor
version which removes need forBox::pin
. - v0.1.3 - Rename
safina
package tosafina-executor
. - v0.1.2 - Update docs
- v0.1.1 - First published version
TO DO
Release Process
- Edit
Cargo.toml
and bump version number. - Run
./release.sh
License: Apache-2.0