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

source

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

source

pub fn set_engine(&self, engine: TraceEngine)

source

pub fn set_clean(&mut self, clean: bool)

source

pub fn set_include_tests(&mut self, include: bool)

source

pub fn include_tests(&self) -> bool

source

pub fn force_clean(&self) -> bool

source

pub fn target_dir(&self) -> PathBuf

source

pub fn profraw_dir(&self) -> PathBuf

Get directory profraws are stored in

source

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

source

pub fn set_target_dir(&mut self, target_dir: PathBuf)

Sets the target dir explicitly

source

pub fn doctest_dir(&self) -> PathBuf

source

pub fn root(&self) -> PathBuf

source

pub fn manifest(&self) -> PathBuf

source

pub fn set_manifest(&mut self, manifest: PathBuf)

source

pub fn output_dir(&self) -> PathBuf

source

pub fn get_config_vec( file_configs: Result<Vec<Self>>, backup: Self, ) -> ConfigWrapper

source

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

Taking an existing config look for any relevant config files

source

pub fn load_config_file<P: AsRef<Path>>(file: P) -> Result<Vec<Self>>

source

pub fn parse_config_toml(buffer: &str) -> Result<Vec<Self>>

source

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

source

pub fn pick_optional_config<T: Clone>( base_config: &Option<T>, override_config: &Option<T>, ) -> Option<T>

source

pub fn objects(&self) -> &[PathBuf]

source

pub fn has_named_tests(&self) -> bool

source

pub fn is_coveralls(&self) -> bool

source

pub fn exclude_path(&self, path: &Path) -> bool

source

pub fn get_base_dir(&self) -> PathBuf

returns the relative path from the base_dir uses root if set, else env::current_dir()

source

pub fn strip_base_dir(&self, path: &Path) -> PathBuf

returns the relative path from the base_dir

source

pub fn is_default_output_dir(&self) -> bool

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
source§

impl<'de> Deserialize<'de> for Config
where Config: Default,

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for Config

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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 T)

🔬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,

§

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>,

§

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>,

§

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
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,