diff --git a/scripts/cov.sh b/scripts/cov.sh index 7f21e9804..13ab792c7 100755 --- a/scripts/cov.sh +++ b/scripts/cov.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Installing KCOV under ubuntu # https://users.rust-lang.org/t/tutorial-how-to-collect-test-coverages-for-rust-project/650# ### Install deps @@ -24,8 +24,7 @@ fi cargo test $TARGETS --no-run || exit $? - -KCOV_TARGET="target/kcov" +KCOV_TARGET="target/cov" KCOV_FLAGS="--verify" EXCLUDE="/usr/lib,\ /usr/include,\ @@ -39,17 +38,25 @@ util/src/network/tests,\ ethcore/src/evm/tests,\ ethstore/tests,\ target/debug/build,\ -target/release/build\ +target/release/build,\ +*.db " rm -rf $KCOV_TARGET mkdir -p $KCOV_TARGET - +echo "Cover RUST" for FILE in `find target/debug/deps ! -name "*.*"` do $KCOV --exclude-pattern $EXCLUDE $KCOV_FLAGS $KCOV_TARGET $FILE done -$KCOV --coveralls-id=${CI_BUILD_ID} --exclude-pattern $EXCLUDE $KCOV_FLAGS $KCOV_TARGET target/debug/parity-* +$KCOV --exclude-pattern $EXCLUDE $KCOV_FLAGS $KCOV_TARGET target/debug/parity-* +echo "Cover JS" +cd js +npm install&&npm run test:coverage +cd .. +codecov +bash <(curl -s https://codecov.io/bash)&& +echo "Uploaded code coverage" exit 0