Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coverage reported as 100% #43

Open
dbrgn opened this issue Jan 26, 2016 · 2 comments
Open

Coverage reported as 100% #43

dbrgn opened this issue Jan 26, 2016 · 2 comments

Comments

@dbrgn
Copy link

dbrgn commented Jan 26, 2016

This is my Travis config file: https://github.com/dbrgn/tldr-rs/blob/23d77aa7d1bc1b2e42fc4bda00f17786a1b1c3a6/.travis.yml

Travis build: https://travis-ci.org/dbrgn/tldr-rs/builds/104879566

And the coveralls page: https://coveralls.io/builds/4853387

For some reason the coverage is reported as 100%, even though that's not true.

Any ideas?

@huonw
Copy link
Owner

huonw commented Jan 26, 2016

This is highly likely to be https://internals.rust-lang.org/t/disabling-gc-sections-when-test-is-specified/2163: the compiler is completely removing the code from dead functions, and so the coverage harness doesn't even know they exist. If it isn't that, then it is more likely to be a bug in kcov or coveralls, than travis-cargo is invoking kcov incorrectly (seems somewhat unlikely: it doesn't pass (m)any options).

To eliminate travis-cargo for sure, you could try running kcov locally if you're on a linux machine, e.g. using these instructions: https://users.rust-lang.org/t/tutorial-how-to-collect-test-coverages-for-rust-project/650

@jonas-schievink
Copy link
Contributor

-C link-dead-code just landed, so this can be fixed in travis-cargo (needs to be made optional, since older Rust versions don't know it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants