pub trait RunTest: Send {
type Artifacts;
// Required methods
fn leaf_name(&self) -> &str;
fn resolve(
&self,
resolver: &ArtifactResolver<'_>,
) -> Option<Self::Artifacts>;
fn run(
&self,
params: PetriTestParams<'_>,
artifacts: Self::Artifacts,
) -> Result<()>;
fn host_requirements(&self) -> Option<&TestCaseRequirements>;
}
Expand description
A test that can be run.
Register it to be run with test!
or multitest!
.
Required Associated Types§
Required Methods§
Sourcefn leaf_name(&self) -> &str
fn leaf_name(&self) -> &str
The leaf name of the test.
To produce the full test name, this will be prefixed with the module name where the test is defined.
Sourcefn resolve(&self, resolver: &ArtifactResolver<'_>) -> Option<Self::Artifacts>
fn resolve(&self, resolver: &ArtifactResolver<'_>) -> Option<Self::Artifacts>
Returns the artifacts required by the test.
Returns None
if this test makes no sense for this host environment
(e.g., an x86_64 test on an aarch64 host) and should be left out of the
test list.
Sourcefn run(
&self,
params: PetriTestParams<'_>,
artifacts: Self::Artifacts,
) -> Result<()>
fn run( &self, params: PetriTestParams<'_>, artifacts: Self::Artifacts, ) -> Result<()>
Runs the test, which has been assigned name
, with the given
artifacts
.
Sourcefn host_requirements(&self) -> Option<&TestCaseRequirements>
fn host_requirements(&self) -> Option<&TestCaseRequirements>
Returns the host requirements of the current test, if any.