fuchsia_async::test_support

Trait TestResult

Source
pub trait TestResult: Sized {
    // Required methods
    fn run_singlethreaded(
        test: &(dyn Sync + Fn(usize) -> Pin<Box<dyn Future<Output = Self>>>),
        cfg: Config,
    ) -> Self;
    fn run_until_stalled<F: 'static + Sync + Fn(usize) -> Fut, Fut: 'static + Future<Output = Self>>(
        fake_time: bool,
        test: F,
        cfg: Config,
    ) -> Self;
    fn is_ok(&self) -> bool;
}
Expand description

Defines how to compose multiple test runs for a kind of test result.

Required Methods§

Source

fn run_singlethreaded( test: &(dyn Sync + Fn(usize) -> Pin<Box<dyn Future<Output = Self>>>), cfg: Config, ) -> Self

How to repeatedly run a test with this result in a single threaded executor.

Source

fn run_until_stalled<F: 'static + Sync + Fn(usize) -> Fut, Fut: 'static + Future<Output = Self>>( fake_time: bool, test: F, cfg: Config, ) -> Self

Similarly, but use run_until_stalled

Source

fn is_ok(&self) -> bool

Whether the result is successful.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl TestResult for ()

Source§

fn run_singlethreaded( test: &(dyn Sync + Fn(usize) -> Pin<Box<dyn Future<Output = Self>>>), cfg: Config, ) -> Self

Source§

fn run_until_stalled<F: Sync + 'static + Fn(usize) -> Fut, Fut: 'static + Future<Output = Self>>( fake_time: bool, test: F, cfg: Config, ) -> Self

Source§

fn is_ok(&self) -> bool

Source§

impl<E: Send + 'static + Debug> TestResult for Result<(), E>

Source§

fn run_singlethreaded( test: &(dyn Sync + Fn(usize) -> Pin<Box<dyn Future<Output = Self>>>), cfg: Config, ) -> Self

Source§

fn run_until_stalled<F: 'static + Sync + Fn(usize) -> Fut, Fut: 'static + Future<Output = Self>>( fake_time: bool, test: F, cfg: Config, ) -> Self

Source§

fn is_ok(&self) -> bool

Implementors§