Struct cargo_tarpaulin::config::Config
source · pub struct Config {Show 50 fields
pub name: String,
pub config: Option<PathBuf>,
pub run_ignored: bool,
pub ignore_panics: bool,
pub verbose: bool,
pub debug: bool,
pub dump_traces: bool,
pub count: bool,
pub line_coverage: bool,
pub branch_coverage: bool,
pub output_directory: Option<PathBuf>,
pub coveralls: Option<String>,
pub ci_tool: Option<CiService>,
pub report_uri: Option<String>,
pub forward_signals: bool,
pub no_dead_code: bool,
pub all_features: bool,
pub no_default_features: bool,
pub all: bool,
pub test_timeout: Duration,
pub release: bool,
pub no_run: bool,
pub locked: bool,
pub frozen: bool,
pub target: Option<String>,
pub offline: bool,
pub command: Mode,
pub run_types: Vec<RunType>,
pub packages: Vec<String>,
pub exclude: Vec<String>,
pub varargs: Vec<String>,
pub features: Option<String>,
pub unstable_features: Vec<String>,
pub generate: Vec<OutputFile>,
pub test_names: HashSet<String>,
pub bin_names: HashSet<String>,
pub example_names: HashSet<String>,
pub bench_names: HashSet<String>,
pub no_fail_fast: bool,
pub profile: Option<String>,
pub fail_under: Option<f64>,
pub metadata: RefCell<Option<Metadata>>,
pub avoid_cfg_tarpaulin: bool,
pub color: Color,
pub follow_exec: bool,
pub jobs: Option<usize>,
pub implicit_test_threads: bool,
pub rustflags: Option<String>,
pub post_test_delay: Option<Duration>,
pub fail_immediately: bool,
/* private fields */
}
Expand description
Specifies the current configuration tarpaulin is using.
Fields§
§name: String
§config: Option<PathBuf>
Path to a tarpaulin.toml config file
run_ignored: bool
Flag to also run tests with the ignored attribute
ignore_panics: bool
Ignore panic macros in code.
verbose: bool
Verbose flag for printing information to the user
debug: bool
Debug flag for printing internal debugging information to the user
dump_traces: bool
Enable the event logger
count: bool
Flag to count hits in coverage
line_coverage: bool
Flag specifying to run line coverage (default)
branch_coverage: bool
Flag specifying to run branch coverage
output_directory: Option<PathBuf>
Directory to write output files
coveralls: Option<String>
Key relating to coveralls service or repo
ci_tool: Option<CiService>
Enum representing CI tool used.
report_uri: Option<String>
Only valid if coveralls option is set. If coveralls option is set, as well as report_uri, then the report will be sent to this endpoint instead.
forward_signals: bool
Forward unexpected signals back to the tracee. Used for tests which rely on signals to work.
no_dead_code: bool
Doesn’t link projects with -Clink-dead-code
all_features: bool
Include all available features in target build
no_default_features: bool
Do not include default features in target build
all: bool
Build all packages in the workspace
test_timeout: Duration
Duration to wait before a timeout occurs
release: bool
Build in release mode
no_run: bool
Build the tests only don’t run coverage
locked: bool
Don’t update Cargo.lock
.
frozen: bool
Don’t update Cargo.lock
or any caches.
target: Option<String>
Build for the target triple.
offline: bool
Run tarpaulin on project without accessing the network
command: Mode
Cargo subcommand to run. So far only test and build are supported
run_types: Vec<RunType>
Types of tests for tarpaulin to collect coverage on
packages: Vec<String>
Packages to include when building the target project
exclude: Vec<String>
Packages to exclude from testing
varargs: Vec<String>
Varargs to be forwarded to the test executables.
features: Option<String>
Features to include in the target project build, e.g. “feature1 feature2”
unstable_features: Vec<String>
Unstable cargo features to use
generate: Vec<OutputFile>
Output files to generate
test_names: HashSet<String>
Names of tests to run corresponding to cargo --test <NAME>...
bin_names: HashSet<String>
Names of binaries to run corresponding to cargo --bin <NAME>...
example_names: HashSet<String>
Names of examples to run corresponding to cargo --example <NAME>...
bench_names: HashSet<String>
Names of benches to run corresponding to cargo --bench <NAME>...
no_fail_fast: bool
Whether to carry on or stop when a test failure occurs
profile: Option<String>
Run with the given profile
fail_under: Option<f64>
returns a non-zero code if coverage is below the threshold
metadata: RefCell<Option<Metadata>>
Result of cargo_metadata ran on the crate
avoid_cfg_tarpaulin: bool
Don’t pass –cfg=tarpaulin to the ‘RUSTFLAG’
color: Color
Colouring of logging
follow_exec: bool
Follow traced executables down
jobs: Option<usize>
Number of jobs used for building the tests
implicit_test_threads: bool
Allow test to use an implicit test threads
rustflags: Option<String>
Specifying per-config rust flags
post_test_delay: Option<Duration>
Delay after test to collect instrumentation files (LLVM only)
fail_immediately: bool
Option to fail immediately after a single test fails
Implementations§
source§impl Config
impl Config
sourcepub fn engine(&self) -> TraceEngine
pub fn engine(&self) -> TraceEngine
This returns the engine selected for tarpaulin to run. This function will not return Auto
instead it will resolve to the best-fit TraceEngine
for the given configuration
pub fn set_engine(&self, engine: TraceEngine)
pub fn set_clean(&mut self, clean: bool)
pub fn set_include_tests(&mut self, include: bool)
pub fn include_tests(&self) -> bool
pub fn force_clean(&self) -> bool
pub fn target_dir(&self) -> PathBuf
sourcepub fn profraw_dir(&self) -> PathBuf
pub fn profraw_dir(&self) -> PathBuf
Get directory profraws are stored in
sourcepub fn set_profraw_folder(&mut self, path: PathBuf)
pub fn set_profraw_folder(&mut self, path: PathBuf)
If a relative directory is joined to $TARGET_DIR/tarpaulin/
otherwise is placed at
absolute directory location
sourcepub fn set_target_dir(&mut self, target_dir: PathBuf)
pub fn set_target_dir(&mut self, target_dir: PathBuf)
Sets the target dir explicitly
pub fn doctest_dir(&self) -> PathBuf
pub fn root(&self) -> PathBuf
pub fn manifest(&self) -> PathBuf
pub fn set_manifest(&mut self, manifest: PathBuf)
pub fn output_dir(&self) -> PathBuf
pub fn get_config_vec( file_configs: Result<Vec<Self>>, backup: Self, ) -> ConfigWrapper
sourcepub fn check_for_configs(&self) -> Option<PathBuf>
pub fn check_for_configs(&self) -> Option<PathBuf>
Taking an existing config look for any relevant config files
pub fn load_config_file<P: AsRef<Path>>(file: P) -> Result<Vec<Self>>
pub fn parse_config_toml(buffer: &str) -> Result<Vec<Self>>
sourcepub fn merge(&mut self, other: &Config)
pub fn merge(&mut self, other: &Config)
Given a config made from args ignoring the config file take the relevant settings that should be carried across and move them
pub fn pick_optional_config<T: Clone>( base_config: &Option<T>, override_config: &Option<T>, ) -> Option<T>
pub fn objects(&self) -> &[PathBuf]
pub fn has_named_tests(&self) -> bool
pub fn is_coveralls(&self) -> bool
pub fn exclude_path(&self, path: &Path) -> bool
sourcepub fn get_base_dir(&self) -> PathBuf
pub fn get_base_dir(&self) -> PathBuf
returns the relative path from the base_dir uses root if set, else env::current_dir()
sourcepub fn strip_base_dir(&self, path: &Path) -> PathBuf
pub fn strip_base_dir(&self, path: &Path) -> PathBuf
returns the relative path from the base_dir
pub fn is_default_output_dir(&self) -> bool
Trait Implementations§
source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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> 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)