pub struct TestEnv { /* private fields */ }
Expand description
A test environment, which is a directory that consists of a simics directory with a set of installed packages and a project directory, where test scripts and resources can be placed.
Implementations§
Source§impl TestEnv
impl TestEnv
Sourcepub fn default_simics_base_dir<P>(simics_home_dir: P) -> Result<PathBuf>
pub fn default_simics_base_dir<P>(simics_home_dir: P) -> Result<PathBuf>
Return a reference to the test base directory
Source§impl TestEnv
impl TestEnv
Sourcepub fn install_files<P>(
project_dir: P,
files: &Vec<(String, Vec<u8>)>,
) -> Result<()>
pub fn install_files<P>( project_dir: P, files: &Vec<(String, Vec<u8>)>, ) -> Result<()>
Install a set of files into a project directory, with the files specified as relative paths inside the project directory and their raw contents
Sourcepub fn install_directories<P>(
project_dir: P,
directories: &Vec<PathBuf>,
) -> Result<()>
pub fn install_directories<P>( project_dir: P, directories: &Vec<PathBuf>, ) -> Result<()>
Install a set of existing directories into a project, where each directory will be copied recursively into the project
Sourcepub fn cleanup(&mut self) -> Result<(), CommandExtError>
pub fn cleanup(&mut self) -> Result<(), CommandExtError>
Clean up the test environment
Sourcepub fn cleanup_if_env(&mut self) -> Result<(), CommandExtError>
pub fn cleanup_if_env(&mut self) -> Result<(), CommandExtError>
Clean up the test environment if the SIMICS_TEST_CLEANUP_EACH environment variable is set
Sourcepub fn test<S>(&mut self, script: S) -> Result<Output, CommandExtError>
pub fn test<S>(&mut self, script: S) -> Result<Output, CommandExtError>
Run a test in the environment in the form of a Simics script. To fail the test, either exit Simics with an error or check the output result.
Sourcepub fn test_python<S>(&mut self, script: S) -> Result<Output, CommandExtError>
pub fn test_python<S>(&mut self, script: S) -> Result<Output, CommandExtError>
Run a test in the environment in the form of a Simics script. To fail the test, either exit Simics with an error or check the output result.
Auto Trait Implementations§
impl Freeze for TestEnv
impl RefUnwindSafe for TestEnv
impl Send for TestEnv
impl Sync for TestEnv
impl Unpin for TestEnv
impl UnwindSafe for TestEnv
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more