diff --git a/.travis.yml b/.travis.yml index 4919c12..7ccbf38 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,3 @@ -# Copied from https://github.com/kennytm/extprim/blob/master/.travis.yml :) - language: rust sudo: false @@ -26,6 +24,7 @@ env: - ARCH=i686 install: + # 1. Install kcov v31. - mkdir -p ~/.cargo/bin - | wget https://github.com/SimonKagstrom/kcov/archive/v31.tar.gz && @@ -39,6 +38,8 @@ install: cd ../.. - export PATH=$HOME/.local/bin:$HOME/.cargo/bin:$HOME/Library/Python/2.7/bin:$PATH - kcov --version + + # 2. Install cross-compiling toolchain. - SYSROOT=$(rustc --print sysroot) - export HOST=$ARCH-unknown-linux-gnu - | @@ -52,6 +53,8 @@ script: - cargo test --target "$HOST" after_success: + # Note: we skip the `check-specimen` test in coverage because kcov cannot do recursive-ptrace. + # Track this file: https://github.com/SimonKagstrom/kcov/blob/master/tests/recursive-ptrace/main.cc - cargo clean - cargo run -- kcov --bin cargo-kcov --coveralls -- --verify diff --git a/README.md b/README.md index 81200f1..bf81138 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ cargo-kcov ========== [![Build status](https://travis-ci.org/kennytm/cargo-kcov.svg?branch=master)](https://travis-ci.org/kennytm/cargo-kcov) -[![Coverage Status](https://coveralls.io/repos/github/kennytm/cargo-kcov/badge.svg?branch=coveralls)](https://coveralls.io/github/kennytm/cargo-kcov?branch=coveralls) +[![Coverage Status](https://coveralls.io/repos/github/kennytm/cargo-kcov/badge.svg?branch=master)](https://coveralls.io/github/kennytm/cargo-kcov?branch=master) [![crates.io](http://meritbadge.herokuapp.com/cargo-kcov)](https://crates.io/crates/cargo-kcov) ![MIT](https://img.shields.io/badge/license-MIT-blue.svg) @@ -28,8 +28,10 @@ Prerequisite > **Important!** `kcov` only supports Linux at the moment. Track > [SimonKagstrom/kcov#135](https://github.com/SimonKagstrom/kcov/issues/135) for OS X support. -You need to install `kcov` v26 or above. Some distro is still shipping v25 or v11, so you will need -to build from source. Please follow the instruction in https://users.rust-lang.org/t/650. +You need to install `kcov` v26 or above to collect coverage report from Rust. Some distro is still +shipping v25 or v11, so you will need to build from source. +Please follow the instruction in https://users.rust-lang.org/t/650. `cargo-kcov` requires v30 or +above since earlier versions of kcov do not report its version number. Install ------- @@ -47,7 +49,7 @@ Options Generate coverage report via kcov USAGE: - cargo kcov [OPTIONS] + cargo kcov [OPTIONS] [--] [ARGS] OPTIONS: --lib Test only this package's library @@ -62,9 +64,13 @@ Options --target Build for the target triple --manifest-path Path to the manifest to build tests for --no-fail-fast Run all tests regardless of failure + --kcov Path to the kcov executable + -o, --output Output directory, default to [target/cov] -v, --verbose Use verbose output + --coveralls Upload merged coverage data to coveralls.io from Travis CI -h, --help Prints help information -V, --version Prints version information - + ARGS: + ... Further arguments passed to kcov