EDIT: I've replaced this question with this one. I will delete this question soon. Thanks for the feedback.
I've setup code coverage in my Rust project, by using travis ci and coveralls. To do this I've used travis-cargo following its documentation. This is my .travis.yml
file:
language: rust
sudo: required
before_script:
- pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH
rust:
- stable
- beta
- nightly
script:
- cargo test
after_success:
- travis-cargo coveralls
However I'm facing a strange high coverage. Some files in the project gets a 100% coverage, even if they are actually not covered at all! Consider for example this file; the only test it contains is a dummy one:
#[cfg(test)]
mod test {
#[test]
fn it_works() {
}
}
And the reported coverage is 100%. As you can see by coverage highlights in the coveralls page, all the source code lines are ignored, except the dummy test function.
What is the problem here? Maybe test binaries strip down unused functions and kcov
cannot see them?