Skip to content

Add --coverage-only-library, make default coverage behavior simpler #1191

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

Closed
mgsloan opened this issue Oct 18, 2015 · 3 comments
Closed

Add --coverage-only-library, make default coverage behavior simpler #1191

mgsloan opened this issue Oct 18, 2015 · 3 comments

Comments

@mgsloan
Copy link
Contributor

mgsloan commented Oct 18, 2015

I'm revisiting #634 ("stack test --coverage shouldn't include tests in reports")

In light of this, I think it's a good idea to put this behavior behind a flag like --coverage-only-library.

@mgsloan
Copy link
Contributor Author

mgsloan commented Oct 18, 2015

Pinging @mboes, does this seem reasonable?

@mboes
Copy link
Contributor

mboes commented Oct 18, 2015

Fair enough. But I assume that, if enabled, one is likely to run into #1181?

@mgsloan
Copy link
Contributor Author

mgsloan commented Oct 19, 2015

I've decided not to do this. This stuff got a bit complicated, I don't expect this to be 100% clear:

I've reinstated my old solution to #1181 with a fix for #1162, so actually I think things should be fine now, and this hopefully isn't "causing issues" any longer.

Also, when I tried out implementing this, but ran into issues with cabal files that have multiple executables, due to https://ghc.haskell.org/trac/ghc/ticket/1853#comment:23 . Since I can't use the hpc program's --include argument to leave out the unqualified modules when there isn't a library stanza (#1162), my solution for now is to munge all tix files to remove unqualified modules.

Since I'm removing all unqualified modules, we don't really get the benefit of having a solution for packages that build their library code directly into their tests.

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

2 participants