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-03-08 15:53:12 +01:00
|
|
|
cargo test \
|
2016-06-29 14:46:29 +02:00
|
|
|
-p ethkey \
|
|
|
|
-p ethstore \
|
2016-03-08 15:53:12 +01:00
|
|
|
-p ethash \
|
|
|
|
-p ethcore-util \
|
|
|
|
-p ethcore \
|
|
|
|
-p ethsync \
|
|
|
|
-p ethcore-rpc \
|
|
|
|
-p parity \
|
2016-05-26 16:41:03 +02:00
|
|
|
-p ethcore-signer \
|
2016-05-26 18:21:15 +02:00
|
|
|
-p ethcore-dapps \
|
2016-03-08 15:53:12 +01:00
|
|
|
--no-run || exit $?
|
2016-02-08 19:12:12 +01:00
|
|
|
rm -rf target/coverage
|
2016-01-19 14:35:56 +01:00
|
|
|
mkdir -p target/coverage
|
2016-03-08 15:53:12 +01:00
|
|
|
|
2016-06-29 14:46:29 +02:00
|
|
|
EXCLUDE="~/.multirust,rocksdb,secp256k1,src/tests,util/json-tests,util/src/network/tests,sync/src/tests,ethcore/src/tests,ethcore/src/evm/tests,ethstore/tests"
|
|
|
|
kcov --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/deps/ethkey-*
|
|
|
|
kcov --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/deps/ethstore-*
|
2016-03-08 15:53:12 +01:00
|
|
|
kcov --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/deps/ethcore-*
|
|
|
|
kcov --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/deps/ethash-*
|
|
|
|
kcov --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/deps/ethcore_util-*
|
|
|
|
kcov --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/deps/ethsync-*
|
|
|
|
kcov --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/deps/ethcore_rpc-*
|
2016-05-26 16:41:03 +02:00
|
|
|
kcov --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/deps/ethcore_signer-*
|
2016-05-26 18:21:15 +02:00
|
|
|
kcov --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/deps/ethcore_dapps-*
|
2016-01-19 14:35:56 +01:00
|
|
|
xdg-open target/coverage/index.html
|