From f270b1d79aa1afe49b0f5250d02f5e467d2a7143 Mon Sep 17 00:00:00 2001 From: Pyfisch Date: Fri, 1 May 2015 12:01:22 +0200 Subject: [PATCH] chore(travis): Enable test coverage generation Generates a test coverage using kcov on travis. The coverage is only generated for beta builds. kcov requires using sudo, so beta builds can't run on container infrastructure anymore. Closes #44 --- .travis.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a9a92f87..54ac7297 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,11 +4,12 @@ matrix: include: - rust: nightly env: FEATURES="--features nightly" + sudo: false - rust: nightly env: FEATURES="--features nightly" BENCH=true + sudo: false - rust: beta - -sudo: false + sudo: true cache: directories: @@ -17,6 +18,12 @@ cache: script: ./.travis.sh after_success: | + [ $TRAVIS_RUST_VERSION = beta ] && + sudo apt-get install libcurl4-openssl-dev libelf-dev libdw-dev && + wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz && + tar xzf master.tar.gz && mkdir kcov-master/build && cd kcov-master/build && cmake .. && make && + sudo make install && cd ../.. && + kcov --coveralls-id=$TRAVIS_JOB_ID --exclude-pattern=/.cargo target/kcov target/debug/hyper-* [ $TRAVIS_BRANCH = master ] && [ $TRAVIS_PULL_REQUEST = false ] && [ $TRAVIS_RUST_VERSION = beta ] &&