#![feature(trait_alias)]
#![cfg_attr(target_os ="none", no_std)]
cfg_if::cfg_if! {
if #[cfg(target_os ="none")]
{
mod semihosting_ext;
pub use embedded_test_macros::tests;
#[cfg(feature = "defmt")]
pub trait FormatOrDebug = defmt::Format;
#[cfg(feature = "log")]
pub trait FormatOrDebug = core::fmt::Debug;
#[doc(hidden)]
pub mod export;
mod sealed {
pub trait Sealed {}
impl Sealed for () {}
impl<T, E> Sealed for Result<T, E> {}
}
pub trait TestOutcome: FormatOrDebug + sealed::Sealed {
fn is_success(&self) -> bool;
}
impl TestOutcome for () {
fn is_success(&self) -> bool {
true
}
}
impl<T: FormatOrDebug, E: FormatOrDebug> TestOutcome for Result<T, E> {
fn is_success(&self) -> bool {
self.is_ok()
}
}
}
}