TestSuite

Struct TestSuite 

Source
#[non_exhaustive]
pub struct TestSuite { pub name: XmlString, pub tests: usize, pub disabled: usize, pub errors: usize, pub failures: usize, pub timestamp: Option<DateTime<FixedOffset>>, pub time: Option<Duration>, pub test_cases: Vec<TestCase>, pub properties: Vec<Property>, pub system_out: Option<XmlString>, pub system_err: Option<XmlString>, pub extra: IndexMap<XmlString, XmlString>, }
Expand description

Represents a single TestSuite.

A TestSuite groups together several TestCase instances.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: XmlString

The name of this TestSuite.

§tests: usize

The total number of tests in this TestSuite.

§disabled: usize

The total number of disabled tests in this TestSuite.

§errors: usize

The total number of tests in this suite that errored.

An “error” is usually some sort of unexpected issue in a test.

§failures: usize

The total number of tests in this suite that failed.

A “failure” is usually some sort of expected issue in a test.

§timestamp: Option<DateTime<FixedOffset>>

The time at which the TestSuite began execution.

§time: Option<Duration>

The overall time taken by the TestSuite.

§test_cases: Vec<TestCase>

The test cases that form this TestSuite.

§properties: Vec<Property>

Custom properties set during test execution, e.g. environment variables.

§system_out: Option<XmlString>

Data written to standard output while the TestSuite was executed.

§system_err: Option<XmlString>

Data written to standard error while the TestSuite was executed.

§extra: IndexMap<XmlString, XmlString>

Other fields that may be set as attributes, such as “hostname” or “package”.

Implementations§

Source§

impl TestSuite

Source

pub fn new(name: impl Into<XmlString>) -> Self

Creates a new TestSuite.

Source

pub fn set_timestamp( &mut self, timestamp: impl Into<DateTime<FixedOffset>>, ) -> &mut Self

Sets the start timestamp for the TestSuite.

Source

pub fn set_time(&mut self, time: Duration) -> &mut Self

Sets the time taken for the TestSuite.

Source

pub fn add_property(&mut self, property: impl Into<Property>) -> &mut Self

Adds a property to this TestSuite.

Source

pub fn add_properties( &mut self, properties: impl IntoIterator<Item = impl Into<Property>>, ) -> &mut Self

Adds several properties to this TestSuite.

Source

pub fn add_test_case(&mut self, test_case: TestCase) -> &mut Self

Adds a TestCase to this TestSuite and updates counts.

When generating a new report, use of this method is recommended over adding to self.test_cases directly.

Source

pub fn add_test_cases( &mut self, test_cases: impl IntoIterator<Item = TestCase>, ) -> &mut Self

Adds several TestCases to this TestSuite and updates counts.

When generating a new report, use of this method is recommended over adding to self.test_cases directly.

Source

pub fn set_system_out(&mut self, system_out: impl Into<XmlString>) -> &mut Self

Sets standard output.

Source

pub fn set_system_out_lossy( &mut self, system_out: impl AsRef<[u8]>, ) -> &mut Self

Sets standard output from a Vec<u8>.

The output is converted to a string, lossily.

Source

pub fn set_system_err(&mut self, system_err: impl Into<XmlString>) -> &mut Self

Sets standard error.

Source

pub fn set_system_err_lossy( &mut self, system_err: impl AsRef<[u8]>, ) -> &mut Self

Sets standard error from a Vec<u8>.

The output is converted to a string, lossily.

Trait Implementations§

Source§

impl Clone for TestSuite

Source§

fn clone(&self) -> TestSuite

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TestSuite

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for TestSuite

Source§

fn eq(&self, other: &TestSuite) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for TestSuite

Source§

impl StructuralPartialEq for TestSuite

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.