pub struct Config {Show 16 fields
pub host: Option<String>,
pub target: Option<String>,
pub stderr_filters: Filter,
pub stdout_filters: Filter,
pub root_dir: PathBuf,
pub mode: Mode,
pub program: CommandBuilder,
pub cfgs: CommandBuilder,
pub output_conflict_handling: OutputConflictHandling,
pub dependencies_crate_manifest_path: Option<PathBuf>,
pub dependency_builder: CommandBuilder,
pub out_dir: PathBuf,
pub edition: Option<String>,
pub skip_files: Vec<String>,
pub filter_files: Vec<String>,
pub threads: Option<NonZeroUsize>,
}Expand description
Central datastructure containing all information to run the tests.
Fields§
§host: Option<String>Host triple; usually will be auto-detected.
target: Option<String>None to run on the host, otherwise a target triple
stderr_filters: FilterFilters applied to stderr output before processing it.
By default contains a filter for replacing backslashes in paths with
regular slashes.
On windows, contains a filter to remove \r.
stdout_filters: FilterFilters applied to stdout output before processing it.
On windows, contains a filter to remove \r.
root_dir: PathBufThe folder in which to start searching for .rs files
mode: ModeThe mode in which to run the tests.
program: CommandBuilderThe binary to actually execute.
cfgs: CommandBuilderThe command to run to obtain the cfgs that the output is supposed to
output_conflict_handling: OutputConflictHandlingWhat to do in case the stdout/stderr output differs from the expected one.
dependencies_crate_manifest_path: Option<PathBuf>Path to a Cargo.toml that describes which dependencies the tests can access.
dependency_builder: CommandBuilderThe command to run can be changed from cargo to any custom command to build the
dependencies in dependencies_crate_manifest_path.
out_dir: PathBufWhere to dump files like the binaries compiled from tests.
Defaults to target/ui in the current directory.
edition: Option<String>The default edition to use on all tests.
skip_files: Vec<String>Skip test files whose names contain any of these entries.
filter_files: Vec<String>Only test files whose names contain any of these entries.
threads: Option<NonZeroUsize>Override the number of threads to use.
Implementations§
source§impl Config
impl Config
sourcepub fn rustc(root_dir: impl Into<PathBuf>) -> Self
pub fn rustc(root_dir: impl Into<PathBuf>) -> Self
Create a configuration for testing the output of running
rustc on the test files.
sourcepub fn cargo(root_dir: impl Into<PathBuf>) -> Self
pub fn cargo(root_dir: impl Into<PathBuf>) -> Self
Create a configuration for testing the output of running
cargo on the test Cargo.toml files.
sourcepub fn with_args(&mut self, args: &Args, default_bless: bool)
pub fn with_args(&mut self, args: &Args, default_bless: bool)
Populate the config with the values from parsed command line arguments.
If neither --bless or --check are provided default_bless is used.
The default output conflict handling command suggests adding --bless
to the end of the current command.
sourcepub fn path_filter(
&mut self,
path: &Path,
replacement: &'static (impl AsRef<[u8]> + ?Sized)
)
pub fn path_filter( &mut self, path: &Path, replacement: &'static (impl AsRef<[u8]> + ?Sized) )
Replace all occurrences of a path in stderr/stdout with a byte string.
sourcepub fn path_stderr_filter(
&mut self,
path: &Path,
replacement: &'static (impl AsRef<[u8]> + ?Sized)
)
pub fn path_stderr_filter( &mut self, path: &Path, replacement: &'static (impl AsRef<[u8]> + ?Sized) )
Replace all occurrences of a path in stderr with a byte string.
sourcepub fn path_stdout_filter(
&mut self,
path: &Path,
replacement: &'static (impl AsRef<[u8]> + ?Sized)
)
pub fn path_stdout_filter( &mut self, path: &Path, replacement: &'static (impl AsRef<[u8]> + ?Sized) )
Replace all occurrences of a path in stdout with a byte string.
sourcepub fn filter(
&mut self,
pattern: &str,
replacement: &'static (impl AsRef<[u8]> + ?Sized)
)
pub fn filter( &mut self, pattern: &str, replacement: &'static (impl AsRef<[u8]> + ?Sized) )
Replace all occurrences of a regex pattern in stderr/stdout with a byte string.
sourcepub fn stderr_filter(
&mut self,
pattern: &str,
replacement: &'static (impl AsRef<[u8]> + ?Sized)
)
pub fn stderr_filter( &mut self, pattern: &str, replacement: &'static (impl AsRef<[u8]> + ?Sized) )
Replace all occurrences of a regex pattern in stderr with a byte string.
sourcepub fn stdout_filter(
&mut self,
pattern: &str,
replacement: &'static (impl AsRef<[u8]> + ?Sized)
)
pub fn stdout_filter( &mut self, pattern: &str, replacement: &'static (impl AsRef<[u8]> + ?Sized) )
Replace all occurrences of a regex pattern in stdout with a byte string.
sourcepub fn build_dependencies(&self) -> Result<Vec<OsString>>
pub fn build_dependencies(&self) -> Result<Vec<OsString>>
Compile dependencies and return the right flags to find the dependencies.
sourcepub fn fill_host_and_target(&mut self) -> Result<()>
pub fn fill_host_and_target(&mut self) -> Result<()>
Make sure we have the host and target triples.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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>
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where C: Color,
§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more