diff options
author | sitkevij <1553398+sitkevij@users.noreply.github.com> | 2020-11-04 09:01:55 -0800 |
---|---|---|
committer | sitkevij <1553398+sitkevij@users.noreply.github.com> | 2020-11-04 09:01:55 -0800 |
commit | 89c1d942d1e3d8cde04ebf278aa02053ac56b91a (patch) | |
tree | 6454d264612ee63b8a74d8e0b443e688560bb512 | |
parent | da9cad29392f56066d21b37e7c7839d6984133b4 (diff) |
#42 add grcov to Makefile
-rw-r--r-- | Makefile | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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) |