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 report doesn't consider any code #1224

Closed
mrkkrp opened this issue Oct 24, 2015 · 6 comments
Closed

Coverage report doesn't consider any code #1224

mrkkrp opened this issue Oct 24, 2015 · 6 comments

Comments

@mrkkrp
Copy link
Collaborator

mrkkrp commented Oct 24, 2015

Previously with the same Cabal file I could get coverage report using Cabal. With Stack I'm getting:

Error: The coverage report for myproject's test-suite "tests" did not consider any code. One possible cause of this is if your test-suite builds the library code (see stack issue #1008). It may also indicate a bug in stack or the hpc program. Please report this issue if you think your coverage report should have meaningful results.

I think it should. GHC options are identical for all components of my package. There is no need for test suite to rebuild the library. After all, if Cabal can generate the report, Stack should be able to do it given the same Cabal config or am I mistaken?

@mrkkrp
Copy link
Collaborator Author

mrkkrp commented Oct 24, 2015

Related: #1181.

@mrkkrp
Copy link
Collaborator Author

mrkkrp commented Oct 24, 2015

$ stack --version
Version 0.1.6.0, Git revision e22271f5ce9afa2cb5be3bad9cafa392c623f85c (2313 commits) x86_64

Here is real Cabal file I'm working with: https://github.com/mrkkrp/megaparsec/blob/master/megaparsec.cabal

I tried to make all flags the same to avoid possible recompilation, then rebuilt, re-tested it and result is the same anyway. I've tried everything, it doesn't work.

@mgsloan
Copy link
Contributor

mgsloan commented Oct 25, 2015

Coverage has changed quite a bit / had a couple fixes applied since v0.1.6.0. In particular:

So, this should work on stack HEAD (use stack upgrade --git to install it). Please close this issue if so, thanks!

@mrkkrp
Copy link
Collaborator Author

mrkkrp commented Oct 25, 2015

@mgsloan, No success, I'm seeing the same error. I've updated stack (now it's Version 0.1.7.0, Git revision 33462aba13f85a3d5c1690c6ee0bb3dd4af6b616 x86_64) but result is the same. I also updated hpc. Anyway, thanks for your reply.

@mrkkrp
Copy link
Collaborator Author

mrkkrp commented Oct 25, 2015

@mgsloan, After some editing of source code of the test suite it now works! Might it be the case that my editing triggered some sort of cache refreshing or something? This seems to work now. I'll experiment more to confirm that the result is reproducible from now on. Thank you again.

@mrkkrp
Copy link
Collaborator Author

mrkkrp commented Oct 25, 2015

Yes, this is resolved. Closing.

@mrkkrp mrkkrp closed this as completed Oct 25, 2015
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