testify_core/
lib.rs

1use std::sync::Mutex;
2
3pub mod runner;
4pub mod test;
5
6pub use runner::run;
7pub use test::TestTermination;
8
9pub static TESTS: Mutex<Vec<test::Test>> = Mutex::new(Vec::new());
10pub static SETUP: Mutex<Option<fn() -> ()>> = Mutex::new(None);
11pub static CLEANUP: Mutex<Option<fn() -> ()>> = Mutex::new(None);
12
13#[cfg(feature = "async-tokio")]
14pub static ASYNC_RT: once_cell::sync::Lazy<tokio::runtime::Runtime> = once_cell::sync::Lazy::new(|| {
15    tokio::runtime::Builder::new_multi_thread()
16        .enable_all()
17        .build()
18        .expect("Could not initialize the tokio runtime")
19});
20
21pub const TEST_RUNNER_TOGGLE_ENV_VAR_NAME: &str = "DO_NOT_MANUALLY_SET_TESTIFY_ARE_TESTS_BEING_RUN";
22pub const TEST_RUNNER_CONFIG: &str = "DO_NOT_MANUALLY_SET_TESTIFY_CONFIG";