From 7c4868e51a80bede16fe96f59b566f002b51dbb3 Mon Sep 17 00:00:00 2001 From: Tomusdrw Date: Tue, 19 Jan 2016 14:35:56 +0100 Subject: [PATCH] Generating coverage report --- cov.sh | 21 +++++++++++++++++++++ util/cov.sh | 1 + 2 files changed, 22 insertions(+) create mode 100755 cov.sh create mode 120000 util/cov.sh diff --git a/cov.sh b/cov.sh new file mode 100755 index 000000000..e7366ab82 --- /dev/null +++ b/cov.sh @@ -0,0 +1,21 @@ +#!/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 + +cargo test --no-run +mkdir -p target/coverage +kcov --verify --skip-solibs target/coverage target/debug/ethcore-* +xdg-open target/coverage/index.html diff --git a/util/cov.sh b/util/cov.sh new file mode 120000 index 000000000..72bb061f8 --- /dev/null +++ b/util/cov.sh @@ -0,0 +1 @@ +../cov.sh \ No newline at end of file