pub trait StaticFixture:
Sized
+ Sync
+ Send {
// Required method
fn set_up_once() -> Result<Self>;
}Expand description
Interface for structure to be set up only once before all tests.
Types implementing StaticFixture can be passed as a double referenced
argument to a test function.
ⓘ
strct MyFixture{ ... }
impl StaticFixture for MyFixture { ... }
#[gtest]
fn test_with_fixture(my_fixture: &&MyFixture){...}Required Methods§
Sourcefn set_up_once() -> Result<Self>
fn set_up_once() -> Result<Self>
Factory method of the StaticFixture.
This method is called by the test harness before the first test case
using this fixture. If this method returns an Err(...), then every
test cases using this fixture are not evaluated.
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.