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
This commit is contained in:
Pyfisch
2015-05-01 12:01:22 +02:00
parent 1426a4ce34
commit f270b1d79a

View File

@@ -4,11 +4,12 @@ matrix:
include: include:
- rust: nightly - rust: nightly
env: FEATURES="--features nightly" env: FEATURES="--features nightly"
sudo: false
- rust: nightly - rust: nightly
env: FEATURES="--features nightly" BENCH=true env: FEATURES="--features nightly" BENCH=true
sudo: false
- rust: beta - rust: beta
sudo: true
sudo: false
cache: cache:
directories: directories:
@@ -17,6 +18,12 @@ cache:
script: ./.travis.sh script: ./.travis.sh
after_success: | 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_BRANCH = master ] &&
[ $TRAVIS_PULL_REQUEST = false ] && [ $TRAVIS_PULL_REQUEST = false ] &&
[ $TRAVIS_RUST_VERSION = beta ] && [ $TRAVIS_RUST_VERSION = beta ] &&