openethereum/cov.sh

22 lines
787 B
Bash
Raw Normal View History

2016-01-19 14:35:56 +01:00
#!/bin/sh
# Installing KCOV under ubuntu
# https://users.rust-lang.org/t/tutorial-how-to-collect-test-coverages-for-rust-project/650#
### Install deps
# $ sudo apt-get install libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc binutils-dev libiberty-dev
#
### Compile kcov
# $ wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz && tar xf master.tar.gz
# $ cd kcov-master && mkdir build && cd build
# $ cmake .. && make && sudo make install
### Running coverage
if ! type kcov > /dev/null; then
echo "Install kcov first (details inside this file). Aborting."
exit 1
fi
2016-01-19 15:02:03 +01:00
cargo test --no-run || exit $?
2016-01-19 14:35:56 +01:00
mkdir -p target/coverage
2016-01-19 14:43:24 +01:00
kcov --exclude-pattern ~/.multirust --include-pattern src --verify target/coverage target/debug/ethcore*
2016-01-19 14:35:56 +01:00
xdg-open target/coverage/index.html