[tasks.clean-all] script = """ cargo clean rm -rf profraw """ [tasks.create-profraw-dir] command = "mkdir" args = ["-p", "./profraw"] [tasks.install-stable] ignore_errors = true command = "rustup" args = ["toolchain", "install", "stable", "--component", "llvm-tools-preview"] [tasks.build-stable] install_crate = false dependencies = ["install-stable"] command = "cargo" args = ["+stable", "build"] [tasks.build-stable.env] RUSTC_BOOTSTRAP="1" RUSTFLAGS="-Zinstrument-coverage" LLVM_PROFILE_FILE="profraw/test-%p-%m.profraw" [tasks.test-stable] install_crate = false dependencies = ["clean-all", "install-stable", "create-profraw-dir"] command = "cargo" args = ["+stable", "test"] [tasks.test-stable.env] RUSTC_BOOTSTRAP="1" RUSTFLAGS="-Zinstrument-coverage -Copt-level=0 -Ccodegen-units=1" LLVM_PROFILE_FILE="profraw/test-%p-%m.profraw" [tasks.grcov] dependencies = ["clean-all", "test-stable"] # Using `script` is necessary to get the glob expansion script = """ grcov profraw/*.profraw --binary-path ./target/debug \ -s . -t html --branch --ignore-not-existing -o ./target/debug/coverage \ --excl-br-line "($EXCLUDE_DERIVE|$EXCLUDE_MANUAL|$EXCLUDE_LONE_CLOSING_BRACE)" \ --excl-line "($EXCLUDE_DERIVE|$EXCLUDE_MANUAL|$EXCLUDE_LONE_CLOSING_BRACE)" \ --excl-br-start "(grcov: ignore-start|mod tests)" --excl-start "(grcov: ignore-start|mod tests)" \ --excl-br-stop "grcov: ignore-end" --excl-stop "grcov: ignore-end" """ [tasks.grcov.env] RUSTFLAGS="-Zinstrument-coverage" RUSTC_BOOTSTRAP="1" RUSTUP_TOOLCHAIN="stable" HOARD_LOG="trace" EXCLUDE_DERIVE="#\\[derive\\(" EXCLUDE_MANUAL="grcov: ignore" EXCLUDE_LONE_CLOSING_BRACE="^\\s*\\}\\s*$" [tasks.view-grcov] dependencies = ["grcov"] command = "xdg-open" args = ["./target/debug/coverage/index.html"]