Struct simics_test::TestEnv
source · pub struct TestEnv {
pub(crate) test_base: PathBuf,
pub(crate) test_dir: PathBuf,
pub(crate) project_dir: PathBuf,
pub(crate) simics_home_dir: PathBuf,
}
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.
Fields§
§test_base: PathBuf
The base of the test environment, e.g. the CARGO_TARGET_TMPDIR
directory
test_dir: PathBuf
The subdirectory in the test environment for this test
project_dir: PathBuf
The project subdirectory in the test environment for this test
simics_home_dir: PathBuf
The simics home subdirectory in the test environment for this test
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
pub(crate) fn build(spec: &TestEnvSpec) -> Result<Self>
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
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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