Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to ignore testcode for code coverage using cabal and hpc?

When using cabal install --enable-tests --enable-library-coverage to generate code coverage reports it will also generate code coverage reports for the testcode. Is there an option for cabal to let hpc ignore testcode?

like image 899
Joost Avatar asked Feb 17 '26 23:02

Joost


1 Answers

I'd be pleasantly surprised if cabal yet has an option for this. Getting HPC to ignore things is (or perhaps used to be) moderately complicated as this example shows: http://www.haskell.org/haskellwiki/Haskell_program_coverage#Example

like image 180
idontgetoutmuch Avatar answered Feb 19 '26 13:02

idontgetoutmuch