coverage for _all_ source files?


Following some other questions, i have the following in my Travis.yml

after_success: |
  sudo apt-get install libcurl4-openssl-dev libelf-dev libdw-dev &&
  wget &&
  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/imagecli-*

I’m struggling to get it to run coverage for the entire src folder. Currently I get src/ but my tests reside in src/ What am I doing wrong here?


I think the coverage only covers whatever files your test suite is using?

I never tried having a test suite not triggering some files though, so I am not 100% on this.


I might be being silly here now that I think about it, but I do recall having issues similar to yours, and that solved it. I can try a version without loop a bit later if using the loop doesn’t work for you.


Oh my apologies, I thought it’s codecov.

To get coveralls working, you need to have a loop I think, see here (line 50)

But this is for a library, hopefully the same for a binary.


Thanks, I haven’t got my mac to hand. But when I do i’ll try this loop - Thanks!


While I don’t have a direct answer to your question, I’d recommend also considering using cargo-coveralls to simplify management of your .travis.yml.