autocommit 2022-05-01 17:23:55 CEST
This commit is contained in:
parent
4373ed05bf
commit
e1d5bf0e5d
39 changed files with 1772 additions and 57 deletions
47
src/it/tests.rs
Normal file
47
src/it/tests.rs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
use {
|
||||
crate::it::{test_error::TestError, testrun::TestRun},
|
||||
std::{future::Future, rc::Rc},
|
||||
};
|
||||
|
||||
macro_rules! testcase {
|
||||
() => {
|
||||
pub struct Test;
|
||||
|
||||
impl crate::it::tests::TestCase for Test {
|
||||
fn name(&self) -> &'static str {
|
||||
module_path!().strip_prefix("jay::it::tests::").unwrap()
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
testrun: std::rc::Rc<crate::it::testrun::TestRun>,
|
||||
) -> Box<dyn std::future::Future<Output = Result<(), TestError>>> {
|
||||
Box::new(test(testrun))
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
macro_rules! tassert {
|
||||
($cond:expr) => {
|
||||
if !$cond {
|
||||
bail!(
|
||||
"Assert `{}` failed ({}:{})",
|
||||
stringify!($cond),
|
||||
file!(),
|
||||
line!()
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
mod t0001_shm_formats;
|
||||
|
||||
pub trait TestCase {
|
||||
fn name(&self) -> &'static str;
|
||||
fn run(&self, testrun: Rc<TestRun>) -> Box<dyn Future<Output = Result<(), TestError>>>;
|
||||
}
|
||||
|
||||
pub fn tests() -> Vec<&'static dyn TestCase> {
|
||||
vec![&t0001_shm_formats::Test]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue