pub struct TestEntry {
pub module: &'static str,
pub name: &'static str,
pub body: TestFn,
pub expected_panic: Option<&'static str>,
pub host_only: bool,
}Expand description
One test the harness knows how to run.
Fields§
§module: &'static strThe module the test was declared in, as module_path! reports it.
Only for diagnostics: the two runners name a test by Self::name,
because a browser is handed one binary that reuses several test files
and would otherwise qualify the same test differently.
name: &'static strThe test’s name, which is unique across the whole suite.
body: TestFnBuilds the future the harness drives.
expected_panic: Option<&'static str>The message a panic is expected to carry, for a #[should_panic] test.
Both runners compare a caught panic against this. The browser needs it before the test runs: a panic aborts a wasm instance instead of unwinding, so the panic hook has to decide the verdict itself.
host_only: boolWhether only the host can run the test, never a browser.
The wasm suite drives the host build of a test binary but runs each trial in a browser, and a browser has neither a filesystem to read a baseline from nor a device to play a mix through. Such a test is compiled out of the wasm build and the proxy skips it, so both sides list the same trials.
Trait Implementations§
Auto Trait Implementations§
impl Forget for TestEntry
impl Freeze for TestEntry
impl RefUnwindSafe for TestEntry
impl Send for TestEntry
impl Sync for TestEntry
impl Unpin for TestEntry
impl UnsafeUnpin for TestEntry
impl UnwindSafe for TestEntry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more