Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tarpaulin.toml configuration file example #1662

Merged
merged 4 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -571,9 +571,9 @@ affects the report output. This is a reserved feature name and any non-reporting
based options chosen will not affect the output of Tarpaulin.

For reference on available keys and their types refer to the CLI help text
at the start of the readme or `src/config/mod.rs` for the concrete types
at the start of the readme or [`src/config/mod.rs`](https://github.com/xd009642/tarpaulin/blob/develop/src/config/mod.rs) for the concrete types
if anything is unclear. For arguments to be passed into the test binary that
follow `--` in Tarpaulin use `args` in the toml file.
follow `--` in Tarpaulin use `args` in the toml file. Find an example in the projects [`tarpaulin.toml](./tarpaulin.toml) file.

Setting the field `config` will not affect the run as it won't be parsed
for additional configuration.
Expand Down
189 changes: 187 additions & 2 deletions tarpaulin.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,189 @@
[test_config]
engine = "Llvm"
follow-exec = true
# The name of the project or the configuration.
name = "tarpaulin"

# Path to the project's cargo manifest.
# The manifest path is required for Tarpaulin to find the project.
manifest-path = "./Cargo.toml"

# Optional path to a custom tarpaulin.toml config file.
# config = null

# Path to the project's root directory.
# This is optional and can be used to override the default location.
# root = null

# Flag to run tests with the ignored attribute.
# If true, ignored tests will be included in the coverage report.
run-ignored = false

# Ignore panic macros in code during coverage analysis.
ignore-panics = false

# Force a clean step before building the project.
# This will clean the target directory before running tests.
force-clean = false

# Skip the clean step and proceed without cleaning the target directory.
skip-clean = true

# Enable verbose logging for user information during tests.
verbose = true

# Enable debugging information for internal issues.
debug = false

# Enable the event logger for trace dumps.
dump-traces = false

# Count hits for coverage, useful for more detailed reporting.
count = true

# Set the type of coverage to be run:
# - 'line' for line coverage (default)
# - 'branch' for branch coverage
line-coverage = true
branch-coverage = false

# Directory to output coverage files and reports.
output-dir = "./coverage_output"

# Optional key for a coveralls service or repository.
# coveralls = null

# Specify the CI server tool for integration with coverage reports.
# Only valid if coveralls is set.
# ci-tool = null

# Report URI to send results to a custom endpoint if provided.
# report-uri = null

# Forward unexpected signals back to the tracee (useful for tests relying on signals).
forward-signals = false

# Flag to disable linking with `-Clink-dead-code`.
no-dead-code = false

# Include all available features in the build.
all-features = false

# Exclude default features from the build.
no-default-features = false

# Build all packages in the workspace.
workspace = false

# Timeout duration for tests to finish.
# (in a format that human-time library can parse, e.g., "5m" for 5 minutes)
test-timeout = "10m"

# Build in release mode for optimized builds.
release = false

# Do not run the tests, only build them (for faster compilation).
no-run = false

# Do not update the `Cargo.lock` file.
locked = false

# Do not update the `Cargo.lock` or any caches.
frozen = false

# Build for a specific target architecture or OS.
# target = null

# Directory for storing generated build artifacts.
target-dir = "./target"

# Run the tests without accessing the network (offline mode).
offline = false

# Cargo subcommand to run; options are "test" or "build".
command = "test"

# Types of tests to collect coverage for. For example: ["unit", "integration"]
run-types = ["unit"]

# List of packages to include when building the target project.
packages = ["my_package"]

# List of packages to exclude from testing.
exclude = []

# List of file paths to exclude from testing.
exclude-files = []

# Additional arguments to pass to the test executables.
args = []

# Features to include in the build, e.g., "feature1 feature2".
# features = null

# List of unstable cargo features to use.
unstable-features = []

# Output files to generate as part of the test execution.
generate = []

# List of test names to run (corresponding to `cargo --test <NAME>`).
test-names = []

# List of binary names to run (corresponding to `cargo --bin <NAME>`).
bin-names = []

# List of example names to run (corresponding to `cargo --example <NAME>`).
example-names = []

# List of bench names to run (corresponding to `cargo --bench <NAME>`).
bench-names = []

# Flag to allow the process to stop immediately on a test failure.
no-fail-fast = false

# Specify a custom profile to use when building.
# profile = null

# Fail if coverage is below the specified threshold (e.g., 80.0).
# fail-under = null

# Metadata generated from `cargo metadata` (this field is internal and usually empty).
# metadata = null

# Flag to avoid passing `--cfg=tarpaulin` to the Rust compiler.
avoid-cfg-tarpaulin = false

# Colouring of logs in the terminal output (e.g., "auto", "always", "never").
color = "auto"

# Follow traced executables down through function calls.
follow-exec = true

# Number of jobs (threads) to use for building the tests.
# jobs = null

# Allow the test suite to use implicit test threads if needed.
implicit-test-threads = true

# Specify the engine to use for collecting coverage (default: "trace").
engine = "Llvm"

# Additional rust flags to be passed during the build process.
# rustflags = null

# Include test functions in the coverage statistics.
include-tests = true

# Delay after tests to collect instrumentation files (LLVM only).
# post-test-delay = 0

# Additional objects to be included in the coverage instrumentation.
objects = []

# Directory where profraw files are stored.
profraw-folder = "./target/profraw"

# Fail immediately after a single test fails.
fail-immediately = false

# Log to stderr instead of the default output.
stderr = false
Loading