pub trait TestCase {
// Required methods
fn qualified_name(&self) -> &'static str;
fn run(&self);
fn ignore(&self) -> Ignore;
fn should_panic(&self) -> ShouldPanic;
// Provided methods
fn name(&self) -> &'static str { ... }
fn modules(&self) -> Option<&'static str> { ... }
}Expand description
A trait representing a test case that can be run and provides metadata about itself.
Required Methods§
Sourcefn qualified_name(&self) -> &'static str
fn qualified_name(&self) -> &'static str
Returns the full name of the test case, including module path (e.g., “my_crate::tests::my_test”).
Sourcefn ignore(&self) -> Ignore
fn ignore(&self) -> Ignore
Whether the test should be excluded or not.
If this method returns Ignore::Yes, the test function will not be run at all (but it will
still be compiled). This allows for time-consuming or expensive tests to be conditionally
disabled.
Sourcefn should_panic(&self) -> ShouldPanic
fn should_panic(&self) -> ShouldPanic
Whether the test is expected to panic.