summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsitkevij <1553398+sitkevij@users.noreply.github.com>2020-11-04 09:01:55 -0800
committersitkevij <1553398+sitkevij@users.noreply.github.com>2020-11-04 09:01:55 -0800
commit89c1d942d1e3d8cde04ebf278aa02053ac56b91a (patch)
tree6454d264612ee63b8a74d8e0b443e688560bb512
parentda9cad29392f56066d21b37e7c7839d6984133b4 (diff)
#42 add grcov to Makefile
-rw-r--r--Makefile16
1 files changed, 16 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 69fd7a6..4f1d1df 100644
--- a/Makefile
+++ b/Makefile
@@ -17,6 +17,7 @@ fmt:
cargo fmt --verbose
debug:
+ export RUSTFLAGS=""
cargo build
release: test
@@ -25,6 +26,21 @@ release: test
test:
cargo test --verbose --all -- --nocapture
+grcov:
+ # grcov requires rust nightly for now
+ rm -rf target/debug/
+ # export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off"
+ export CARGO_INCREMENTAL=0 && \
+ export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort" && \
+ export RUSTDOCFLAGS="-Cpanic=abort" && \
+ cargo +nightly build
+ cargo +nightly test --verbose
+ # generate html report
+ grcov ./target/debug/ -s . -t html --llvm --branch --ignore-not-existing -o ./target/debug/coverage/
+ # open report
+ open target/debug/coverage/index.html
+
+
install: release debug test
cargo install --path .
## cp $(RELEASE_DIR)/$(BINARY) $(INSTALL_DIR)/$(BINARY)