[][src]Struct libtest_mimic::Test

pub struct Test<D = ()> {
    pub name: String,
    pub kind: String,
    pub is_ignored: bool,
    pub is_bench: bool,
    pub data: D,
}

Description of a single test.

Fields

name: String

The name of the test. It's displayed in the output and used for all kinds of filtering.

kind: String

Optional string to describe the kind of test. If this string is not empty, it is printed in brackets before the test name (e.g. test [my-kind] test_name).

is_ignored: bool

Whether or not this test should be ignored. If the --ignored flag is set, ignored tests are executed, too.

is_bench: bool

Whether this test is actually a benchmark.

data: D

Custom data. This field is not used by this library and can instead be used to store arbitrary data per test.

Implementations

impl<D: Default> Test<D>[src]

pub fn test(name: impl Into<String>) -> Self[src]

Creates a test with the given name, an empty kind and default data. The test is not ignored and is not a benchmark.

pub fn bench(name: impl Into<String>) -> Self[src]

Creates a benchmark with the given name, an empty kind and default data. The benchmark is not ignored.

Trait Implementations

impl<D: Clone> Clone for Test<D>[src]

impl<D: Debug> Debug for Test<D>[src]

Auto Trait Implementations

impl<D> RefUnwindSafe for Test<D> where
    D: RefUnwindSafe

impl<D> Send for Test<D> where
    D: Send

impl<D> Sync for Test<D> where
    D: Sync

impl<D> Unpin for Test<D> where
    D: Unpin

impl<D> UnwindSafe for Test<D> where
    D: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.