Tarpaulin: Add ability to exclude a particular file from coverage reports

Created on 14 Dec 2017  路  5Comments  路  Source: xd009642/tarpaulin

I have a file that contains a giant generated enum, plus conversion methods for said enum. I'd like to exclude this file from my coverage report, as it's not a meaningful file to test, yet it contains a lot of files (and thus significantly reduces coverage). Unless I'm mistaken --exclude only lets me exclude subcrates, not individual files or modules?

enhancement

Most helpful comment

Tested and merged into develop!

All 5 comments

I just realized that I can ignore particular files and directories directly on the coverage platform, so maybe this feature is less important. It'd still be nice for when I run cargo tarpaulin manually though.

I can definitely see the use for people not using a third party coverage platform. I'll add this to my list of things to add when I get some free time :+1:

So on https://github.com/xd009642/tarpaulin/tree/issue_73 you can try out the file excluding if you wish.

It does it on end path so if you just put mod.rs it would exclude every one. If you put src/mod.rs it would exclude that specific one. I am going to expand to adding wildcards so you could do something like (using your source as an example) src/value/* or maybe something more regex based. Any preferences as a user? :smile:

Right * wildcard is, functioning the same as globbing in unix. So you can do all sorts like */mod.rs src/value/*etc etc. Going to test it some more for stability but when I'm happy it'll be merged into develop and I'll close the issue

Tested and merged into develop!

Was this page helpful?
0 / 5 - 0 ratings