From e318f782504fcdc06e2da552f04e89bded807ec5 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 28 Jul 2023 20:23:04 +0100 Subject: [PATCH] add justfile with coverage creation rules --- .gitignore | 6 ++++-- justfile | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 justfile diff --git a/.gitignore b/.gitignore index c233fd4..a3bd0cd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ target *.mp3 *.webm -/subscriptions.txt -/downloaded.txt +subscriptions.txt +downloaded.txt +coverage +*.profraw diff --git a/justfile b/justfile new file mode 100644 index 0000000..933e5e8 --- /dev/null +++ b/justfile @@ -0,0 +1,23 @@ +coverage-init: + cargo install grcov + rustup component add llvm-tools + +coverage: + #!/usr/bin/env bash + set -e + rm -rf ./target + just clean + export RUSTFLAGS="-Zinstrument-coverage" LLVM_PROFILE_FILE="just-%p-%m.profraw" + cargo +nightly build + cargo +nightly test + just generate + just server + +generate: + grcov . --binary-path ./target/debug/ -s . -t html --branch --ignore-not-existing --ignore "./target/" -o ./coverage/ + +server: + cd ./coverage && python3 -m http.server 8001 + +clean: + rm -rf ./*.prof* ./coverage/