Struct cargo_tarpaulin::config::Config
source · [−]pub struct Config {Show 50 fields
pub name: String,
pub manifest: PathBuf,
pub config: Option<PathBuf>,
pub run_ignored: bool,
pub ignore_tests: bool,
pub ignore_panics: bool,
pub all_targets: 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 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>,
/* private fields */
}
Expand description
Specifies the current configuration tarpaulin is using.
Fields
name: String
manifest: PathBuf
Path to the projects cargo manifest
config: Option<PathBuf>
Path to a tarpaulin.toml config file
run_ignored: bool
Flag to also run tests with the ignored attribute
ignore_tests: bool
Flag to ignore test functions in coverage statistics
ignore_panics: bool
Ignore panic macros in code.
all_targets: bool
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.
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
Implementations
sourceimpl 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_clean(&mut self, clean: bool)
pub fn force_clean(&self) -> bool
pub fn target_dir(&self) -> PathBuf
pub fn doctest_dir(&self) -> PathBuf
pub fn root(&self) -> PathBuf
pub fn get_packages(&self) -> Vec<Package>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
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: &[u8]) -> 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 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
sourceimpl<'de> Deserialize<'de> for Config where
Config: Default,
impl<'de> Deserialize<'de> for Config where
Config: Default,
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more