From ed8aaf300deac9d8de93c874d6c6f88b35c3b47a Mon Sep 17 00:00:00 2001 From: Bas van Driel Date: Wed, 11 Dec 2024 13:56:13 +0100 Subject: [PATCH 1/4] Add example to README --- README.md | 193 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 192 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a3887fbcea..65c77d7518 100644 --- a/README.md +++ b/README.md @@ -573,7 +573,198 @@ 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 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 `tarpaulin.toml` file below. + +```toml +# The name of the project or the configuration. +name = "my_project" + +# 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 = false + +# 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 `). +test-names = [] + +# List of binary names to run (corresponding to `cargo --bin `). +bin-names = [] + +# List of example names to run (corresponding to `cargo --example `). +example-names = [] + +# List of bench names to run (corresponding to `cargo --bench `). +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 = false + +# 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 = "trace" + +# 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 = null + +# 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 +``` Setting the field `config` will not affect the run as it won't be parsed for additional configuration. From 1d688709639b7726e19bbb941a59128d39a6cf83 Mon Sep 17 00:00:00 2001 From: Bas van Driel Date: Wed, 11 Dec 2024 13:59:15 +0100 Subject: [PATCH 2/4] update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 65c77d7518..94b08a192f 100644 --- a/README.md +++ b/README.md @@ -571,7 +571,7 @@ 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. Find an example `tarpaulin.toml` file below. From 7546279fa1a94fade06027e46195d40a79a3c331 Mon Sep 17 00:00:00 2001 From: Bas van Driel Date: Wed, 11 Dec 2024 14:00:49 +0100 Subject: [PATCH 3/4] Add [all] section --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 94b08a192f..70b2df518a 100644 --- a/README.md +++ b/README.md @@ -576,6 +576,7 @@ if anything is unclear. For arguments to be passed into the test binary that follow `--` in Tarpaulin use `args` in the toml file. Find an example `tarpaulin.toml` file below. ```toml +[all] # The name of the project or the configuration. name = "my_project" From 746b3192e329ba4f48668a71c8231cf74ed19206 Mon Sep 17 00:00:00 2001 From: Bas van Driel Date: Wed, 11 Dec 2024 14:30:04 +0100 Subject: [PATCH 4/4] Change example --- README.md | 194 +------------------------------------------------ tarpaulin.toml | 189 ++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 188 insertions(+), 195 deletions(-) diff --git a/README.md b/README.md index 70b2df518a..401ccd6414 100644 --- a/README.md +++ b/README.md @@ -573,199 +573,7 @@ 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`](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. Find an example `tarpaulin.toml` file below. - -```toml -[all] -# The name of the project or the configuration. -name = "my_project" - -# 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 = false - -# 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 `). -test-names = [] - -# List of binary names to run (corresponding to `cargo --bin `). -bin-names = [] - -# List of example names to run (corresponding to `cargo --example `). -example-names = [] - -# List of bench names to run (corresponding to `cargo --bench `). -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 = false - -# 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 = "trace" - -# 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 = null - -# 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 -``` +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. diff --git a/tarpaulin.toml b/tarpaulin.toml index f6d987290f..fc91b1a18b 100644 --- a/tarpaulin.toml +++ b/tarpaulin.toml @@ -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 `). +test-names = [] + +# List of binary names to run (corresponding to `cargo --bin `). +bin-names = [] + +# List of example names to run (corresponding to `cargo --example `). +example-names = [] + +# List of bench names to run (corresponding to `cargo --bench `). +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 \ No newline at end of file