pub enum TestCaseStatus {
Success {
flaky_runs: Vec<TestRerun>,
},
NonSuccess {
kind: NonSuccessKind,
message: Option<XmlString>,
ty: Option<XmlString>,
description: Option<XmlString>,
reruns: NonSuccessReruns,
},
Skipped {
message: Option<XmlString>,
ty: Option<XmlString>,
description: Option<XmlString>,
},
}Expand description
Represents the success or failure of a test case.
Variants§
Success
This test case passed.
Fields
NonSuccess
This test case did not pass.
Fields
kind: NonSuccessKindWhether this test case failed in an expected way (failure) or an unexpected way (error).
description: Option<XmlString>The description of the failure.
This is serialized and deserialized from the text node of the element.
reruns: NonSuccessRerunsTest reruns and how they are serialized.
See NonSuccessReruns for details.
Skipped
This test case was not run.
Implementations§
Source§impl TestCaseStatus
impl TestCaseStatus
Sourcepub fn non_success(kind: NonSuccessKind) -> Self
pub fn non_success(kind: NonSuccessKind) -> Self
Creates a new TestCaseStatus that represents an unsuccessful test.
Sourcepub fn set_message(&mut self, message: impl Into<XmlString>) -> &mut Self
pub fn set_message(&mut self, message: impl Into<XmlString>) -> &mut Self
Sets the message. No-op if this is a success case.
Sourcepub fn set_type(&mut self, ty: impl Into<XmlString>) -> &mut Self
pub fn set_type(&mut self, ty: impl Into<XmlString>) -> &mut Self
Sets the type. No-op if this is a success case.
Sourcepub fn set_description(
&mut self,
description: impl Into<XmlString>,
) -> &mut Self
pub fn set_description( &mut self, description: impl Into<XmlString>, ) -> &mut Self
Sets the description (text node). No-op if this is a success case.
Sourcepub fn add_rerun(&mut self, rerun: TestRerun) -> &mut Self
pub fn add_rerun(&mut self, rerun: TestRerun) -> &mut Self
Adds a rerun or flaky run. No-op if this test was skipped.
For Success, reruns are always serialized as <flakyFailure>/<flakyError>.
For NonSuccess, the rerun is added to the existing NonSuccessReruns variant.
Sourcepub fn add_reruns(
&mut self,
new_reruns: impl IntoIterator<Item = TestRerun>,
) -> &mut Self
pub fn add_reruns( &mut self, new_reruns: impl IntoIterator<Item = TestRerun>, ) -> &mut Self
Adds reruns or flaky runs. No-op if this test was skipped.
For Success, reruns are always serialized as <flakyFailure>/<flakyError>.
For NonSuccess, reruns are added to the existing NonSuccessReruns variant.
Sourcepub fn set_rerun_kind(&mut self, kind: FlakyOrRerun) -> &mut Self
pub fn set_rerun_kind(&mut self, kind: FlakyOrRerun) -> &mut Self
Sets the rerun kind for NonSuccess statuses.
This controls how reruns are serialized in JUnit XML. Use
FlakyOrRerun::Flaky for <flakyFailure>/<flakyError> (the test exhibited
flakiness), or FlakyOrRerun::Rerun for <rerunFailure>/<rerunError> (the
default).
This is a no-op for Success (in which case reruns are always
serialized as flaky) and Skipped (no reruns).
Trait Implementations§
Source§impl Arbitrary for TestCaseStatus
impl Arbitrary for TestCaseStatus
Source§type Parameters = ()
type Parameters = ()
arbitrary_with accepts for configuration
of the generated Strategy. Parameters must implement Default.Source§type Strategy = BoxedStrategy<TestCaseStatus>
type Strategy = BoxedStrategy<TestCaseStatus>
Strategy used to generate values of type Self.Source§fn arbitrary_with(
args_shared: <Self as Arbitrary>::Parameters,
) -> Self::Strategy
fn arbitrary_with( args_shared: <Self as Arbitrary>::Parameters, ) -> Self::Strategy
Source§impl Clone for TestCaseStatus
impl Clone for TestCaseStatus
Source§fn clone(&self) -> TestCaseStatus
fn clone(&self) -> TestCaseStatus
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TestCaseStatus
impl Debug for TestCaseStatus
Source§impl PartialEq for TestCaseStatus
impl PartialEq for TestCaseStatus
impl Eq for TestCaseStatus
impl StructuralPartialEq for TestCaseStatus
Auto Trait Implementations§
impl Freeze for TestCaseStatus
impl RefUnwindSafe for TestCaseStatus
impl Send for TestCaseStatus
impl Sync for TestCaseStatus
impl Unpin for TestCaseStatus
impl UnwindSafe for TestCaseStatus
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
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
§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.