diff --git a/README.md b/README.md index 07f4faf..ad51003 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,10 @@ > Markdown Table of Content generator ![](https://github.com/kevingimbel/mktoc/workflows/Clippy%20check/badge.svg) +![Coverage](assets/coverage/flat.svg) # Table of Contents - - [About](#about) - [Installation](#installation) - [Cargo](#cargo) diff --git a/assets/coverage/flat.svg b/assets/coverage/flat.svg new file mode 100644 index 0000000..986182a --- /dev/null +++ b/assets/coverage/flat.svg @@ -0,0 +1,23 @@ + + coverage: 100% + + + + + + + + + + + + + + + coverage + + 100% + + + \ No newline at end of file diff --git a/helpers/coverage.sh b/helpers/coverage.sh new file mode 100755 index 0000000..0c01356 --- /dev/null +++ b/helpers/coverage.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +export LLVM_PROFILE_FILE="fd-%p-%m.profraw" +export RUSTFLAGS="-Cinstrument-coverage" + +# build project +cargo build + +# run tests to create the profraw files needed by grcov +cargo test + +# run grcov with "defaults", this is straight up taken from their README +grcov . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing -o ./target/debug/coverage/ + +# copy badge to asset directory +cp target/debug/coverage/badges/flat.svg assets/coverage + +# cleanup +rm ./*.profraw \ No newline at end of file