[tasks.coverage-linux]
script = ["cargo tarpaulin --workspace --all-features --tests --out Html"]
[tasks.coverage-mac]
script = [
'''
export CARGO_INCREMENTAL=0
export RUSTFLAGS="-Cinstrument-coverage"
export LLVM_PROFILE_FILE="target/coverage/profraw/project-%p-%m.profraw"
cargo clean
cargo test --all --workspace
grcov . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing -o target/coverage/
echo "Coverage report generated at target/coverage/html/index.html"
'''
]
[tasks.coverage]
description = "Run OS-specific coverage"
run_task = [
{ name = "coverage-linux", condition = { platforms = ["linux"] } },
{ name = "coverage-mac", condition = { platforms = ["mac"] } }
]