Struct SmokeModuleTest

Source
pub struct SmokeModuleTest<'a> {
    pub dependency_name: &'a str,
    pub version: &'a str,
    pub local_path_clause: &'a str,
    pub code: String,
    pub test_path: PathBuf,
    pub test_postfix: &'a str,
}
Expand description

Context for smoke testing of a module.

Fields§

§dependency_name: &'a str

Name of module.

§version: &'a str

Version of module.

§local_path_clause: &'a str

Local path to the module.

§code: String

Code to run during smoke testing.

§test_path: PathBuf

Path to temp directory to put all files.

§test_postfix: &'a str

Postfix to add to name.

Implementations§

Source§

impl<'a> SmokeModuleTest<'a>

Source

pub fn new(dependency_name: &'a str) -> SmokeModuleTest<'a>

Constructor of a context for smoke testing.

Source

pub fn version(&mut self, version: &'a str) -> &mut SmokeModuleTest<'a>

Set version.

Source

pub fn local_path_clause( &mut self, local_path_clause: &'a str, ) -> &mut SmokeModuleTest<'a>

Set local path.

Source

pub fn test_postfix( &mut self, test_postfix: &'a str, ) -> &mut SmokeModuleTest<'a>

Set postfix to add to name of test.

Source

pub fn code(&mut self, code: String) -> &mut SmokeModuleTest<'a>

Get code.

Source

pub fn form(&mut self) -> Result<(), &'static str>

Prepare files at temp dir for smoke testing. Prepare files at temp dir for smoke testing.

§Panics

This function will panic if it fails to create the directory or write to the file.

§Errors

Returns an error if the operation fails.

Source

pub fn perform(&self) -> Result<(), &'static str>

Do smoke testing. Do smoke testing.

§Panics

This function will panic if the command execution fails or if the smoke test fails.

§Errors

Returns an error if the operation fails.

Source

pub fn clean(&self, force: bool) -> Result<(), &'static str>

Cleaning temp directory after testing. Cleaning temp directory after testing.

§Panics

This function will panic if it fails to remove the directory and force is set to false.

§Errors

Returns an error if the operation fails.

Trait Implementations§

Source§

impl<'a> Debug for SmokeModuleTest<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for SmokeModuleTest<'a>

§

impl<'a> RefUnwindSafe for SmokeModuleTest<'a>

§

impl<'a> Send for SmokeModuleTest<'a>

§

impl<'a> Sync for SmokeModuleTest<'a>

§

impl<'a> Unpin for SmokeModuleTest<'a>

§

impl<'a> UnwindSafe for SmokeModuleTest<'a>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V