From 1e3c2fbf1850400f09db600d067dff456ae9bf81 Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Sat, 16 Feb 2019 15:28:43 +0100 Subject: [PATCH] Try again --- .travis.yml | 12 +++--------- tests/.travis-runner.sh | 22 +++++++++++++++++++++- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index dc5b5da07a..cbab6ae216 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,6 +32,7 @@ matrix: env: - TRAVIS_RUST_VERSION=stable - REGULAR_TEST=false + - CODE_COVERAGE=false script: tests/.travis-runner.sh - language: python python: 3.6 @@ -45,6 +46,7 @@ matrix: env: - TRAVIS_RUST_VERSION=beta - REGULAR_TEST=false + - CODE_COVERAGE=false script: tests/.travis-runner.sh - name: rustfmt language: rust @@ -107,20 +109,12 @@ matrix: directories: - /home/travis/.cargo - target - before_script: - - curl -L https://github.com/mozilla/grcov/releases/download/v0.4.1/grcov-linux-x86_64.tar.bz2 | tar jxf - script: - - cargo build --verbose --all - - cargo test --verbose --all - tests/.travis-runner.sh - - zip -0 ccov.zip `find . \( -name "rustpython*.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 env: - TRAVIS_RUST_VERSION=nightly - REGULAR_TEST=false - - CARGO_INCREMENTAL=0 - - RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads" + - CODE_COVERAGE=true allow_failures: - rust: nightly env: REGULAR_TEST=true diff --git a/tests/.travis-runner.sh b/tests/.travis-runner.sh index 680b18ea4b..bb6108d18c 100755 --- a/tests/.travis-runner.sh +++ b/tests/.travis-runner.sh @@ -10,7 +10,27 @@ pip install pipenv (cd tests; pipenv install) # Build outside of the test runner -cargo build --verbose --release +if [ $CODE_COVERAGE = "true" ] +then + export CARGO_INCREMENTAL=0 + export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads" + + cargo build --verbose +else + cargo build --verbose --release +fi # Run the tests (cd tests; pipenv run pytest) + +if [ $CODE_COVERAGE = "true" ] +then + cargo test --verbose --all + zip -0 ccov.zip `find . \( -name "rustpython*.gc*" \) -print` + + # Install grcov + curl -L https://github.com/mozilla/grcov/releases/download/v0.4.1/grcov-linux-x86_64.tar.bz2 | tar jxf - + + ./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