Stack: Pass options to HPC (like --xml-output)

Created on 11 Sep 2018  ·  2Comments  ·  Source: commercialhaskell/stack

I could not find a way to pass options to HPC (as documented in https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/profiling.html#hpc-report).

The one I am particularly interested in is --xml-output to be able to parse coverage (and hopefully convert it into SonarQube-compatible code coverage later). I could not find an equivalent in stack, stack hpc or stack hpc report documentation/help.

benchmark coverage options parsing profiling help wanted enhancement

All 2 comments

Hey @Sir4ur0n - thanks for reporting this. It seems like a reasonable feature request to me, and probably not terribly difficult to implement. Would you be interested in making a PR?

In the meantime I think you could probably adapt this to your needs:

stack exec -- hpc report --xml-output $(find $(stack path --local-hpc-root) -name \*.tix)

Thank you @mattaudesse for the tip, I still have struggle to make it work but I think it's more my lack of understanding of GHC code coverage. At least stack exec -- hpc report correctly offers all the HPC options, so I'm no longer blocked.

Keeping this issue open for when somebody (could be me 😄 ) is motivated to add this feature.

Was this page helpful?
0 / 5 - 0 ratings