diff options
Diffstat (limited to 'ci/script.sh')
-rw-r--r-- | ci/script.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ci/script.sh b/ci/script.sh index 9ad8677..6aada36 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -1,6 +1,11 @@ set -exo pipefail main() { + if [ ! -z $COVERAGE ] && [ $TRAVIS_RUST_VERSION = nightly ]; then + export CARGO_INCREMENTAL=0; + export RUSTFLAGS="-Zprofile -Ccodegen-units=1"; + fi + if [[ ! $TARGET =~ .*linux.* ]]; then sed -i "s/linux-embedded-hal/#linux-embedded-hal/g" Cargo.toml sed -i "s/embedded-hal-mock/#embedded-hal-mock/g" Cargo.toml @@ -18,7 +23,15 @@ main() { if [ -z $DISABLE_TESTS ] && [ $TRAVIS_RUST_VERSION = nightly ] && [[ $TARGET =~ .*linux.* ]]; then cargo test --target $TARGET $FEATURES + if [ ! -z $COVERAGE ]; then + zip -0 ccov.zip `find . \( -name "ads1x1x*.gc*" -o -name "llvmgcov.gc*" \) -print`; + grcov ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore-dir "/*" > lcov.info; + bash <(curl -s https://codecov.io/bash) -f lcov.info; + fi + fi fi + + } main |