Closed emmabastas closed 1 year ago
The issue link is broken should probably be https://github.com/haskell/cabal/issues/3902?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
Coverage report for 57f77ee: https://emmabastas.github.io/elm-format/57f77ee/hpc_index.html
Thanks! I followed your approach and added some build scripts in https://github.com/avh4/elm-format/pull/808. Now dev/build.sh serve:coverage
will show the coverage report for the integration tests.
This issue is intended as a place to describe how I generate coverage reports for elm-format using hpc, for future reference.
Code commits in emmabastas/elm-format:coverage-report
The gist of it
ghc is instructed to compile with coverage tracking using the
-fhpc
compiler flag. This flag is appended toghc-options
in all five of the<package-name>.cabal
files.A new script, coverage-report.sh is run to generate a report in html. The script basically wraps a call to
hpc markup
with some additional options.Other approaches
Cabal has support for adding coverage tracking via a config option. To add coverage tracking at the cabal level instead of compiler level might appear more natural for elm-format, but after failed attempts and reading haskell/cabal#3902 I came to the conclusion that elm-format's setup with multiple local cabal packages and integration tests probably falls outside the scope of cabals support for hpc.