Struct TestSuite

Source
pub struct TestSuite {
    pub name: String,
    pub settings: TestSuiteSettings,
    pub test_settings: TestCaseSettings,
    /* private fields */
}
Expand description

Test suite representing a group of tests.

Fields§

§name: String

Name of the test group.

§settings: TestSuiteSettings

Settings to use for the test suite.

§test_settings: TestCaseSettings

Test settings to use for all tests.

Implementations§

Source§

impl TestSuite

Source

pub fn new(name: String) -> TestSuite

Create a new test suite.

Source

pub fn new_with_settings( name: String, settings: TestSuiteSettings, test_settings: TestCaseSettings, ) -> TestSuite

Create a new test suite with given suite and test settings.

Source

pub fn push(&mut self, test: TestCase)

Add a test to the suite.

Tests added to the suite will be run when the suite is executed.

Source

pub fn run(&mut self, serial: &mut Serial) -> Result<bool, String>

Run all tests belonging to the test suite on given serial port.

Execution will stop early if stop_on_failure is set and a test fails.

Source

pub fn run_and_print(&mut self, serial: &mut Serial, quiet: bool) -> bool

Run all tests belonging to the test suite on given serial port and print the results.

Execution will stop early if stop_on_failure is set and a test fails.

Source

pub fn len(&self) -> usize

Get the number of tests belonging to the test suite.

Source

pub fn is_empty(&self) -> bool

Check if any test belongs to the test suite.

Source

pub fn failed(&self) -> usize

Get the number of failed tests.

Will return 0 if not run before.

Source

pub fn successful(&self) -> usize

Get the number of successful tests.

Will return 0 if not run before.

Trait Implementations§

Source§

impl Debug for TestSuite

Source§

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

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

impl ToString for TestSuite

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more

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> 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, 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.