Macro mfio_rt::net_test_suite
source · macro_rules! net_test_suite { ($test_ident:ident, $fs_builder:expr) => { ... }; }
Available on crate feature
test_suite
only.Expand description
Builds network test suite.
The first parameter of the macro is the name of the generated module, while the second one contains a closure containing the test name and an asynchronous closure to be executed.
The closure that runs contains the entire test_suite and net modules. It accepts a &'static mut T
where T: Tcp
. To get a static ref, use the staticify
function. It is unsound, but
necessary to make test suite generation code ergonomic.
Examples
use mfio_rt::*;
net_test_suite!(net_tests_default, |closure| {
let _ = ::env_logger::builder().is_test(true).try_init();
let mut rt = NativeRt::default();
let rt = staticify(&mut rt);
rt.run(closure);
});