pub(crate) struct FileManager {
opts: Opts,
}
Fields§
§opts: Opts
Implementations§
Source§impl FileManager
impl FileManager
pub(crate) fn new(opts: Opts) -> Self
Sourcepub(crate) fn init(&self) -> Result<()>
pub(crate) fn init(&self) -> Result<()>
Initialize file related stuff.
- Create necessary directories.
- Convert source files.
Sourcepub(crate) fn source_of(&self, test_name: &str) -> Result<PathBuf>
pub(crate) fn source_of(&self, test_name: &str) -> Result<PathBuf>
Try to find the input file of test_name
.
Sourcepub(crate) fn output_of(&self, test_name: &str) -> Result<PathBuf>
pub(crate) fn output_of(&self, test_name: &str) -> Result<PathBuf>
Try to find the output file of test_name
.
Sourcepub(crate) fn diff_of(&self, test_name: &str) -> Result<PathBuf>
pub(crate) fn diff_of(&self, test_name: &str) -> Result<PathBuf>
Try to find the diff file of test_name
.
Sourcepub(crate) fn expected_output_of(&self, test_name: &str) -> Result<PathBuf>
pub(crate) fn expected_output_of(&self, test_name: &str) -> Result<PathBuf>
Try to find the expected output file of test_name
.
Sourcepub(crate) fn convert_source_files(&self) -> Result<()>
pub(crate) fn convert_source_files(&self) -> Result<()>
Convert source files in input dir, use Self::replace_placeholder
.
Sourcefn convert_source_files_internal(
&self,
input_subdir: &str,
dest_subdir: &str,
suffix: &str,
) -> Result<()>
fn convert_source_files_internal( &self, input_subdir: &str, dest_subdir: &str, suffix: &str, ) -> Result<()>
Converts files ends with “.source” suffix in input_subdir
and output them to
dest_subdir
with filename ends with suffix
The input_subdir
is relative to crate::Opts::input_dir
, and output_subdir
is
relative to crate::Opts::output_dir
.
Sourcefn replace_placeholder<P: AsRef<Path>>(&self, input: P, output: P) -> Result<()>
fn replace_placeholder<P: AsRef<Path>>(&self, input: P, output: P) -> Result<()>
Replace predefined placeholders in input
with correct values and output them to
output
.
§Placeholders
@abs_srcdir@
: Absolute path of input directory.@abs_builddir@
: Absolute path of output directory.@testtablespace@
: Absolute path of tablespace for test.
fn test_table_space_dir(&self) -> Result<PathBuf>
fn result_dir(&self) -> Result<PathBuf>
Auto Trait Implementations§
impl Freeze for FileManager
impl RefUnwindSafe for FileManager
impl Send for FileManager
impl Sync for FileManager
impl Unpin for FileManager
impl UnwindSafe for FileManager
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
Mutably borrows from an owned value. Read more