Last active
August 12, 2017 08:08
-
-
Save dermesser/7a94229cc6bdfaae070e1ecd04ef6fdb to your computer and use it in GitHub Desktop.
generate coverage reports for Rust crates. This needs kcov installed.
This file contains hidden or 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
#!/bin/bash | |
KCOV=kcov | |
KCOV_OPTS="--verify --exclude-pattern=/.cargo" | |
KCOV_OUT="./kcov-out/" | |
export RUSTFLAGS="-C link-dead-code" | |
TEST_BIN=$(cargo test --no-run 2>&1 >/dev/null | awk '/^ Running target\/debug\// { print $2 }') | |
${KCOV} ${KCOV_OPTS} ${KCOV_OUT} ${TEST_BIN} && xdg-open ${KCOV_OUT}/index.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment