1
0
Fork 0
forked from wry/wry

autocommit 2022-05-01 17:23:55 CEST

This commit is contained in:
Julian Orth 2022-05-01 17:23:55 +02:00
parent 4373ed05bf
commit e1d5bf0e5d
39 changed files with 1772 additions and 57 deletions

47
src/it/tests.rs Normal file
View 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]
}