-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add coverage badge and script
- Loading branch information
1 parent
273495d
commit f8cb654
Showing
3 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |