pub enum Runner {
Suite,
Crate,
}Expand description
Which runner produced a result, and therefore how the test is named and re-run.
The repository has exactly two that a claim may name today. A third would be a variant
here and a branch in TestId::of; a claim naming something neither runner produces is
reported as ProofState::Unrunnable rather than silently counted as covered.
use majordomus_cli::evidence::{Runner, TestId};
// which runner owns a test is read off where the test lives, never declared
assert_eq!(TestId::of("test/cases/07_scope.sh").unwrap().runner, Runner::Suite);
assert_eq!(
TestId::of("apps/majordomus-cli/tests/why.rs").unwrap().runner,
Runner::Crate
);
// and a path under neither directory belongs to no runner at all
assert!(TestId::of("test/lib.sh").is_none());§Example
use majordomus_cli::evidence::Runner;
assert_eq!(Runner::Suite.prefix(), "suite");
assert_eq!(Runner::Crate.prefix(), "crate");Variants§
Suite
A behavioural case under test/cases/, run by test/run.sh.
Crate
An integration test binary under apps/majordomus-cli/tests/, run by cargo test.
Implementations§
Source§impl Runner
impl Runner
Sourcepub fn prefix(self) -> &'static str
pub fn prefix(self) -> &'static str
The prefix this runner’s test ids carry, and the half of TestId::as_string that
says which runner has to be asked for the proof again.
The two are distinct words on purpose: a case and a test binary may share a name, and a ledger keyed on the bare name would let one record overwrite the other’s.
use majordomus_cli::evidence::Runner;
assert_eq!(Runner::Suite.prefix(), "suite");
assert_eq!(Runner::Crate.prefix(), "crate");
assert_ne!(Runner::Suite.prefix(), Runner::Crate.prefix());Trait Implementations§
impl Copy for Runner
Source§impl<'de> Deserialize<'de> for Runner
impl<'de> Deserialize<'de> for Runner
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Runner
Source§impl JsonSchema for Runner
impl JsonSchema for Runner
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Ord for Runner
impl Ord for Runner
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Runner
impl PartialOrd for Runner
impl StructuralPartialEq for Runner
Auto Trait Implementations§
impl Freeze for Runner
impl RefUnwindSafe for Runner
impl Send for Runner
impl Sync for Runner
impl Unpin for Runner
impl UnsafeUnpin for Runner
impl UnwindSafe for Runner
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.