Add CI code coverage #21
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This changeset changes the Travis CI config to run tests as usual, but assuming
cargo test
passes, it usesafter_success:
to download and buildkcov
, re-runs the test executable to collect code coverage info, and posts it to codecov.io.Here's Travis build output and the codecov coverage report from this branch on my repo if you'd like to see what it looks like. All the
after_success:
stuff is all collapsed on Travis by default, so it's nowhere near as noisy as you might think based on the.travis.yml
.You would need to sign up with Codecov before merging, though like Travis, it's free for open source software.
Finally, it's worth noting that while the code coverage data is correct on a line by line basis, the code coverage statistics are incorrect (rust-lang/rust#39293). The coverage information shows which code paths get executed and which do not, but generic functions which were never codegen'd for the test executable do not count against the coverage percentage. For example,
RudyMap
shows 100% coverage… but the report also indicates thatremove()
,contains_key()
,get_mut()
,len()
, andis_empty()
are never called.