From 0cfee8b0876a2076ae908443b5ad7589c381204d Mon Sep 17 00:00:00 2001 From: Nordine Bittich Date: Sat, 30 Nov 2024 21:44:50 +0100 Subject: [PATCH] coverage script --- .gitignore | 2 ++ coverage.sh | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 coverage.sh diff --git a/.gitignore b/.gitignore index 4fffb2f..d4f3c97 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /target /Cargo.lock +*.profraw + diff --git a/coverage.sh b/coverage.sh new file mode 100644 index 0000000..db4f202 --- /dev/null +++ b/coverage.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Doc for grcov +# https://github.com/mozilla/grcov +# + +set -xe +rm -f *.profraw +cargo clean +export RUSTFLAGS="-Cinstrument-coverage" +cargo build +export LLVM_PROFILE_FILE="tortank-%p-%m.profraw" +cargo test +grcov . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing -o ./target/debug/coverage/ +xdg-open "target/debug/coverage/index.html"