summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiego Barrios Romero <eldruin@gmail.com>2018-11-14 19:03:35 +0100
committerDiego Barrios Romero <eldruin@gmail.com>2018-11-14 19:03:35 +0100
commitb10ac1d14b237eddebb24fb9721658603ed7de02 (patch)
tree64b181eaebbf8af0b019d5a34bf75105ad57c4bf
parentd362db1c0d314838a546dacd3ddc0eca287ca4de (diff)
downloadads1x1x-async-b10ac1d14b237eddebb24fb9721658603ed7de02.tar.gz
ads1x1x-async-b10ac1d14b237eddebb24fb9721658603ed7de02.tar.xz
ads1x1x-async-b10ac1d14b237eddebb24fb9721658603ed7de02.zip
Try lcov and codecov.io
-rw-r--r--.travis.yml35
-rw-r--r--ci/script.sh13
2 files changed, 31 insertions, 17 deletions
diff --git a/.travis.yml b/.travis.yml
index a6aa9cd..4099f0e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,15 +10,27 @@ before_script:
matrix:
include:
- env: TARGET=x86_64-unknown-linux-gnu
- before_script:
- - cargo install cargo-update || echo "cargo-update already installed"
- - cargo install cargo-travis || echo "cargo-travis already installed"
- - cargo install-update -a
- after_success:
- - cargo coveralls --verbose
- env: TARGET=x86_64-unknown-linux-gnu
rust: nightly
+ addons:
+ apt:
+ sources:
+ - ubuntu-toolchain-r-test
+ - sourceline: 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-7 main'
+ key_url: 'http://apt.llvm.org/llvm-snapshot.gpg.key'
+ packages:
+ - llvm-7-dev
+ - clang-7
+ - g++-7
+ env:
+ - GCC_CXX=g++-7
+ - GCOV=gcov-7
+ - CLANG_CXX=clang++-7
+ - LLVM_CONFIG=llvm-config-7
+ - COVERAGE=1
+ before_script:
+ - cargo install grcov
- env: TARGET=x86_64-unknown-linux-musl
rust: nightly
@@ -41,17 +53,6 @@ matrix:
- env: TARGET=thumbv7m-none-eabi
rust: beta
-addons:
- apt:
- packages:
- - libcurl4-openssl-dev
- - libelf-dev
- - libdw-dev
- - binutils-dev
- - cmake
- sources:
- - kalakris-cmake
-
before_install:
- set -e
- rustup self update
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