pub struct CrateBinary {
pub name: String,
pub outcome: Outcome,
pub seconds: u64,
pub passed: u64,
pub failed: u64,
pub ignored: u64,
pub filtered_out: u64,
}Expand description
One integration test binary of a cargo test run, as its result line stated it.
name is the binary’s source under tests/ without the extension, never the hashed
file cargo built, which changes between builds. The counts are the result line’s own
(a count the line did not carry is 0), and outcome is decided from them by the rule
read_crate_output states: a binary that ran nothing is not a pass.
use majordomus_cli::evidence::{read_crate_output, CrateBinary, Outcome};
let read = read_crate_output(
" Running tests/why.rs (target/debug/deps/why-1)\n\
test result: ok. 1 passed; 0 failed; 2 ignored; 0 measured; 4 filtered out; \
finished in 0.60s\n",
);
let why: &CrateBinary = &read.binaries[0];
assert_eq!(why.name, "why");
assert_eq!((why.passed, why.failed, why.ignored, why.filtered_out), (1, 0, 2, 4));
assert_eq!(why.seconds, 1, "0.60s rounds to the nearest second");
assert_eq!(why.outcome, Outcome::Skip, "a filtered subset is not the binary's proof");Fields§
§name: StringThe binary’s name: tests/<name>.rs without the directory and the extension.
outcome: OutcomeWhat the binary’s result line, read by its counts, says happened.
seconds: u64finished in rounded to whole seconds; 0 when the line carried none.
passed: u64Tests that ran and passed.
failed: u64Tests that ran and failed.
ignored: u64Tests that were compiled in and not run.
filtered_out: u64Tests a name filter left out of this run.
Trait Implementations§
Source§impl Clone for CrateBinary
impl Clone for CrateBinary
Source§fn clone(&self) -> CrateBinary
fn clone(&self) -> CrateBinary
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CrateBinary
impl Debug for CrateBinary
impl Eq for CrateBinary
Source§impl PartialEq for CrateBinary
impl PartialEq for CrateBinary
Source§fn eq(&self, other: &CrateBinary) -> bool
fn eq(&self, other: &CrateBinary) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CrateBinary
Auto Trait Implementations§
impl Freeze for CrateBinary
impl RefUnwindSafe for CrateBinary
impl Send for CrateBinary
impl Sync for CrateBinary
impl Unpin for CrateBinary
impl UnsafeUnpin for CrateBinary
impl UnwindSafe for CrateBinary
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
Mutably borrows from an owned value. Read more
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> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.