test(coverage): Add manual coverage script.

This commit is contained in:
Lewin Bormann
2019-06-22 22:19:53 +02:00
parent 9a334e2d21
commit e108c75b48

12
coverage.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
KCOV=kcov
KCOV_OPTS="--verify --exclude-pattern=/.cargo"
KCOV_OUT="./kcov-out/"
export RUSTFLAGS="-C link-dead-code"
TEST_BIN=$(cargo test 2>&1 >/dev/null | awk '/^ Running target\/debug\// { print $2 }')
${KCOV} ${KCOV_OPTS} ${KCOV_OUT} ${TEST_BIN} && xdg-open ${KCOV_OUT}/index.html