#[cfg(not(target_arch = "wasm32"))]
use ctor::{ctor, dtor};
use std::cell::RefCell;
thread_local! {
pub(crate) static LOG_MESSAGES: RefCell<Vec<String>> = const { RefCell::new(Vec::new()) };
}
pub mod data;
pub mod logger;
#[cfg(not(target_arch = "wasm32"))]
#[ctor]
fn before_all() {
better_panic::Settings::new()
.most_recent_first(true)
.lineno_suffix(false)
.backtrace_first(true)
.install();
logger::install();
}
#[cfg(not(target_arch = "wasm32"))]
#[dtor]
fn after_all() {
logger::clear_log_messages();
}
#[derive(Debug)]
pub struct TestError {}
impl<Err: std::fmt::Display> From<Err> for TestError {
#[track_caller]
fn from(err: Err) -> Self {
panic!("{}: {}", std::any::type_name::<Err>(), err);
}
}
pub type TestResult = anyhow::Result<(), TestError>;
pub fn init() {}