compiletest::common

Struct Config

Source
pub struct Config {
Show 80 fields pub bless: bool, pub compile_lib_path: PathBuf, pub run_lib_path: PathBuf, pub rustc_path: PathBuf, pub cargo_path: Option<PathBuf>, pub rustdoc_path: Option<PathBuf>, pub coverage_dump_path: Option<PathBuf>, pub python: String, pub jsondocck_path: Option<String>, pub jsondoclint_path: Option<String>, pub llvm_filecheck: Option<PathBuf>, pub llvm_bin_dir: Option<PathBuf>, pub run_clang_based_tests_with: Option<String>, pub src_base: PathBuf, pub build_base: PathBuf, pub sysroot_base: PathBuf, pub stage_id: String, pub mode: Mode, pub suite: String, pub debugger: Option<Debugger>, pub run_ignored: bool, pub with_rustc_debug_assertions: bool, pub with_std_debug_assertions: bool, pub filters: Vec<String>, pub skip: Vec<String>, pub filter_exact: bool, pub force_pass_mode: Option<PassMode>, pub run: Option<bool>, pub logfile: Option<PathBuf>, pub runner: Option<String>, pub host_rustcflags: Vec<String>, pub target_rustcflags: Vec<String>, pub rust_randomized_layout: bool, pub optimize_tests: bool, pub target: String, pub host: String, pub cdb: Option<OsString>, pub cdb_version: Option<[u16; 4]>, pub gdb: Option<String>, pub gdb_version: Option<u32>, pub lldb_version: Option<u32>, pub llvm_version: Option<Version>, pub system_llvm: bool, pub android_cross_path: PathBuf, pub adb_path: String, pub adb_test_dir: String, pub adb_device_status: bool, pub lldb_python_dir: Option<String>, pub verbose: bool, pub format: OutputFormat, pub color: ColorConfig, pub remote_test_client: Option<PathBuf>, pub compare_mode: Option<CompareMode>, pub rustfix_coverage: bool, pub has_html_tidy: bool, pub has_enzyme: bool, pub channel: String, pub git_hash: bool, pub edition: Option<String>, pub cc: String, pub cxx: String, pub cflags: String, pub cxxflags: String, pub ar: String, pub target_linker: Option<String>, pub host_linker: Option<String>, pub llvm_components: String, pub nodejs: Option<String>, pub npm: Option<String>, pub force_rerun: bool, pub only_modified: bool, pub target_cfgs: OnceLock<TargetCfgs>, pub builtin_cfg_names: OnceLock<HashSet<String>>, pub nocapture: bool, pub git_repository: String, pub nightly_branch: String, pub git_merge_commit_email: String, pub profiler_runtime: bool, pub diff_command: Option<String>, pub minicore_path: PathBuf,
}
Expand description

Configuration for compiletest

Fields§

§bless: bool

true to overwrite stderr/stdout files instead of complaining about changes in output.

§compile_lib_path: PathBuf

The library paths required for running the compiler.

§run_lib_path: PathBuf

The library paths required for running compiled programs.

§rustc_path: PathBuf

The rustc executable.

§cargo_path: Option<PathBuf>

The cargo executable.

§rustdoc_path: Option<PathBuf>

The rustdoc executable.

§coverage_dump_path: Option<PathBuf>

The coverage-dump executable.

§python: String

The Python executable to use for LLDB and htmldocck.

§jsondocck_path: Option<String>

The jsondocck executable.

§jsondoclint_path: Option<String>

The jsondoclint executable.

§llvm_filecheck: Option<PathBuf>

The LLVM FileCheck binary path.

§llvm_bin_dir: Option<PathBuf>

Path to LLVM’s bin directory.

§run_clang_based_tests_with: Option<String>

The path to the Clang executable to run Clang-based tests with. If None then these tests will be ignored.

§src_base: PathBuf

The directory containing the tests to run

§build_base: PathBuf

The directory where programs should be built

§sysroot_base: PathBuf

The directory containing the compiler sysroot

§stage_id: String

The name of the stage being built (stage1, etc)

§mode: Mode

The test mode, e.g. ui or debuginfo.

§suite: String

The test suite (essentially which directory is running, but without the directory prefix such as tests)

§debugger: Option<Debugger>

The debugger to use in debuginfo mode. Unset otherwise.

§run_ignored: bool

Run ignored tests

§with_rustc_debug_assertions: bool

Whether rustc was built with debug assertions.

§with_std_debug_assertions: bool

Whether std was built with debug assertions.

§filters: Vec<String>

Only run tests that match these filters

§skip: Vec<String>

Skip tests matching these substrings. Corresponds to test::TestOpts::skip. filter_exact does not apply to these flags.

§filter_exact: bool

Exactly match the filter, rather than a substring

§force_pass_mode: Option<PassMode>

Force the pass mode of a check/build/run-pass test to this mode.

§run: Option<bool>

Explicitly enable or disable running.

§logfile: Option<PathBuf>

Write out a parseable log of tests that were run

§runner: Option<String>

A command line to prefix program execution with, for running under valgrind for example.

Similar to CARGO_*_RUNNER configuration.

§host_rustcflags: Vec<String>

Flags to pass to the compiler when building for the host

§target_rustcflags: Vec<String>

Flags to pass to the compiler when building for the target

§rust_randomized_layout: bool

Whether the compiler and stdlib has been built with randomized struct layouts

§optimize_tests: bool

Whether tests should be optimized by default. Individual test-suites and test files may override this setting.

§target: String

Target system to be tested

§host: String

Host triple for the compiler being invoked

§cdb: Option<OsString>

Path to / name of the Microsoft Console Debugger (CDB) executable

§cdb_version: Option<[u16; 4]>

Version of CDB

§gdb: Option<String>

Path to / name of the GDB executable

§gdb_version: Option<u32>

Version of GDB, encoded as ((major * 1000) + minor) * 1000 + patch

§lldb_version: Option<u32>

Version of LLDB

§llvm_version: Option<Version>

Version of LLVM

§system_llvm: bool

Is LLVM a system LLVM

§android_cross_path: PathBuf

Path to the android tools

§adb_path: String

Extra parameter to run adb on arm-linux-androideabi

§adb_test_dir: String

Extra parameter to run test suite on arm-linux-androideabi

§adb_device_status: bool

status whether android device available or not

§lldb_python_dir: Option<String>

the path containing LLDB’s Python module

§verbose: bool

Explain what’s going on

§format: OutputFormat

Print one character per test instead of one line

§color: ColorConfig

Whether to use colors in test.

§remote_test_client: Option<PathBuf>

where to find the remote test client process, if we’re using it

§compare_mode: Option<CompareMode>

mode describing what file the actual ui output will be compared to

§rustfix_coverage: bool

If true, this will generate a coverage file with UI test files that run MachineApplicable diagnostics but are missing run-rustfix annotations. The generated coverage file is created in /<build_base>/rustfix_missing_coverage.txt

§has_html_tidy: bool

whether to run tidy (html-tidy) when a rustdoc test fails

§has_enzyme: bool

whether to run enzyme autodiff tests

§channel: String

The current Rust channel

§git_hash: bool

Whether adding git commit information such as the commit hash has been enabled for building

§edition: Option<String>

The default Rust edition

§cc: String§cxx: String§cflags: String§cxxflags: String§ar: String§target_linker: Option<String>§host_linker: Option<String>§llvm_components: String§nodejs: Option<String>

Path to a NodeJS executable. Used for JS doctests, emscripten and WASM tests

§npm: Option<String>

Path to a npm executable. Used for rustdoc GUI tests

§force_rerun: bool

Whether to rerun tests even if the inputs are unchanged.

§only_modified: bool

Only rerun the tests that result has been modified according to Git status

§target_cfgs: OnceLock<TargetCfgs>§builtin_cfg_names: OnceLock<HashSet<String>>§nocapture: bool§git_repository: String§nightly_branch: String§git_merge_commit_email: String§profiler_runtime: bool

True if the profiler runtime is enabled for this target. Used by the “needs-profiler-runtime” directive in test files.

§diff_command: Option<String>

Command for visual diff display, e.g. diff-tool --color=always.

§minicore_path: PathBuf

Path to minicore aux library, used for no_core tests that need core stubs in cross-compilation scenarios that do not otherwise want/need to -Zbuild-std. Used in e.g. ABI tests.

Implementations§

Source§

impl Config

Source

pub fn run_enabled(&self) -> bool

Source

pub fn target_cfgs(&self) -> &TargetCfgs

Source

pub fn target_cfg(&self) -> &TargetCfg

Source

pub fn matches_arch(&self, arch: &str) -> bool

Source

pub fn matches_os(&self, os: &str) -> bool

Source

pub fn matches_env(&self, env: &str) -> bool

Source

pub fn matches_abi(&self, abi: &str) -> bool

Source

pub fn matches_family(&self, family: &str) -> bool

Source

pub fn is_big_endian(&self) -> bool

Source

pub fn get_pointer_width(&self) -> u32

Source

pub fn can_unwind(&self) -> bool

Source

pub fn builtin_cfg_names(&self) -> &HashSet<String>

Get the list of builtin, ‘well known’ cfg names

Source

pub fn has_threads(&self) -> bool

Source

pub fn has_asm_support(&self) -> bool

Source

pub fn git_config(&self) -> GitConfig<'_>

Source§

impl Config

Source

fn parse_and_update_revisions( &self, testfile: &Path, line: &str, existing: &mut Vec<String>, )

Source

fn parse_env(nv: String) -> (String, String)

Source

fn parse_pp_exact(&self, line: &str, testfile: &Path) -> Option<PathBuf>

Source

fn parse_custom_normalization( &self, line: &str, prefix: &str, ) -> Option<(String, String)>

Source

fn parse_name_directive(&self, line: &str, directive: &str) -> bool

Source

fn parse_negative_name_directive(&self, line: &str, directive: &str) -> bool

Source

pub fn parse_name_value_directive( &self, line: &str, directive: &str, ) -> Option<String>

Source

pub fn find_rust_src_root(&self) -> Option<PathBuf>

Source

fn parse_edition(&self, line: &str) -> Option<String>

Source

fn set_name_directive(&self, line: &str, directive: &str, value: &mut bool)

Source

fn set_name_value_directive<T>( &self, line: &str, directive: &str, value: &mut Option<T>, parse: impl FnOnce(String) -> T, )

Source

fn push_name_value_directive<T>( &self, line: &str, directive: &str, values: &mut Vec<T>, parse: impl FnOnce(String) -> T, )

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Config

Source§

fn default() -> Config

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl !Freeze for Config

§

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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 1896 bytes