Change kcov to tarpaulin
Tarpaulin works much better with generic functions.
Change the PR Travis job to also run on nightly, such that tarpaulin
gets executed.
@@ -30,7 +30,7 @@ matrix:
rust: nightly
- name: "PR Open"
if: type = pull_request AND branch = master
- rust: stable
+ rust: nightly
- name: "Minimal Versions"
if: branch = staging OR branch = trying OR type = cron OR ( type = pull_request AND branch = master )
rust: nightly
@@ -58,27 +58,22 @@ env:
addons:
apt:
packages:
- - libcurl4-openssl-dev
- - libelf-dev
- - libdw-dev
- - binutils-dev
- - libiberty-dev
+ - libssl-dev
before_script:
# Allow this step to fail in case clippy is not available for whatever reason
- ( rustup component add clippy-preview || true )
- export PATH=$HOME/.cargo/bin:$PATH
- which cargo-install-update || cargo install cargo-update
- - which cargo-kcov || cargo install cargo-kcov
- - cargo fetch && cargo install-update -a
+ # Update cargo metadata to make cargo install-update work
+ - cargo fetch
+ # Install or update cargo tarpaulin
- |
- if [ ! -x $HOME/.cargo/bin/kcov ] || [ ! -f $HOME/.cargo/bin/kcov ]; then
- mkdir kcov
- cd kcov
- cargo kcov --print-install-kcov-sh | sh
- cd ${TRAVIS_BUILD_DIR}
- rm -rf kcov
+ if [[ "$TRAVIS_RUST_VERSION" == nightly ]]; then
+ which cargo-tarpaulin || env RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install-update --allow-no-update cargo-tarpaulin
fi
+ # Update all tools
+ - cargo install-update -a
script:
- set -e
@@ -91,6 +86,12 @@ script:
( which cargo-clippy >/dev/null 2>&1 && cargo clippy --verbose --all ${FEATURES_COMMAND} ) || true
cargo test --verbose --all ${FEATURES_COMMAND}
done
- - cargo kcov --verbose --no-clean-rebuild --features=chrono,json
- - bash <(curl -s https://codecov.io/bash)
- - echo "CodeCov Uploading of data was successful!"
+
+after_success:
+ - |
+ if [[ "$TRAVIS_RUST_VERSION" == nightly ]]; then
+ # Uncomment the following two lines create and upload a report for codecov.io
+ cargo tarpaulin --out Xml --skip-clean --all --all-features
+ bash <(curl -s https://codecov.io/bash)
+ echo "CodeCov Uploading of data was successful!"
+ fi
