[config]
default_to_workspace = false
[tasks.clean-profraw]
script_runner = "@duckscript"
script = '''
files = glob_array ./**/*.profraw
for f in ${files}
rm ${f}
end
'''
[tasks.llvm_install]
toolchain = "nightly"
install_crate = { rustup_component_name = "llvm-tools-preview" }
[tasks.build-cov]
extend = "build"
toolchain = "nightly"
env = { RUSTFLAGS="-Zinstrument-coverage" }
dependencies = ["llvm_install", "clean-profraw"]
[tasks.test-cov]
extend = "test"
toolchain = "nightly"
env = { LLVM_PROFILE_FILE="coverage-%p-%m.profraw", RUST_LOG="debug" }
dependencies = ["build-cov"]
args = [
"test",
"--workspace",
"${@}",
]
[tasks.coverage]
clear = true
description = "Runs source-based code coverage."
category = "Test"
script_runner = "@shell"
script = "RUSTUP_TOOLCHAIN=nightly grcov . --binary-path ./target/debug -s . -t html --branch --ignore-not-existing -o ./target/debug/coverage/"
dependencies = ["test-cov"]
[tasks.cov]
alias = "coverage"
[tasks.test-debug]
extend = "test"
args = ["test", "--", "--nocapture"]
env = { RUST_LOG="debug" }