From 7c4868e51a80bede16fe96f59b566f002b51dbb3 Mon Sep 17 00:00:00 2001 From: Tomusdrw Date: Tue, 19 Jan 2016 14:35:56 +0100 Subject: [PATCH 1/5] 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 From 33d8fdca3f2cc2114621a4bccb1af3ea7c979293 Mon Sep 17 00:00:00 2001 From: Tomusdrw Date: Tue, 19 Jan 2016 14:43:24 +0100 Subject: [PATCH 2/5] Fixing include/exclude patterns --- cov.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cov.sh b/cov.sh index e7366ab82..7d13c8c96 100755 --- a/cov.sh +++ b/cov.sh @@ -15,7 +15,7 @@ if ! type kcov > /dev/null; then exit 1 fi -cargo test --no-run +cargo test --no-run || exit 2 mkdir -p target/coverage -kcov --verify --skip-solibs target/coverage target/debug/ethcore-* +kcov --exclude-pattern ~/.multirust --include-pattern src --verify target/coverage target/debug/ethcore* xdg-open target/coverage/index.html From 0885f44f5062a25fd82449c1fd5a108912d19c3b Mon Sep 17 00:00:00 2001 From: Tomusdrw Date: Tue, 19 Jan 2016 15:02:03 +0100 Subject: [PATCH 3/5] Fixing error code --- cov.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cov.sh b/cov.sh index 7d13c8c96..9f2a87a47 100755 --- a/cov.sh +++ b/cov.sh @@ -15,7 +15,7 @@ if ! type kcov > /dev/null; then exit 1 fi -cargo test --no-run || exit 2 +cargo test --no-run || exit $? mkdir -p target/coverage kcov --exclude-pattern ~/.multirust --include-pattern src --verify target/coverage target/debug/ethcore* xdg-open target/coverage/index.html From c0a923a2716fe97c9e41f34b77987dc0bd719d87 Mon Sep 17 00:00:00 2001 From: debris Date: Wed, 20 Jan 2016 15:55:29 +0100 Subject: [PATCH 4/5] basic .travis.yml --- .travis.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..a5b361fc4 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ +language: rust + +rust: + - nightly + +os: + - osx + +before_script: + - brew update + - brew install rocksdb From a3ced5140ce07f90e3f4ef0d191d66669e891a03 Mon Sep 17 00:00:00 2001 From: Nikolay Volf Date: Wed, 20 Jan 2016 18:43:29 +0300 Subject: [PATCH 5/5] cache directories --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index a5b361fc4..1efef4f21 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,3 +9,8 @@ os: before_script: - brew update - brew install rocksdb + +cache: + directories: + - $TRAVIS_BUILD_DIR/target + - $HOME/.cargo \ No newline at end of file