You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ghc is instructed to compile with coverage tracking using the -fhpc compiler flag. This flag is appended to ghc-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.
The text was updated successfully, but these errors were encountered:
Thanks! I followed your approach and added some build scripts in #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.
The text was updated successfully, but these errors were encountered: