[Haskell-cafe] HPC of several modules?

Magnus Therning magnus at therning.org
Wed Jan 16 12:40:32 EST 2008


How do I get reports on coverage of all modules in a program?

The documentation I've found http://blog.unsafeperformio.com/?p=18 and
http://www.haskell.org/ghc/docs/latest/html/users_guide/hpc.html both do
coverage of a single module.  Going the naive route of first making sure
there are no compiled modules in my source tree (i.e. removing all .o and
.hi files) then running 'ghc --make -fhpc MyTool.hs' succeeds in building
the program, and I get a MyTool.tix and a .mix file in .hpc/ for each module
after running it, but how do I get 'hpc' to produce reports containing more
than just Main?

'hpc6 markup MyTool' includes only Main
'hpc6 markup MyTool Main My.Module' includes only Main
'hpc6 markup MyTool My.Module' results in an error:
    Writing: hpc_index.html
    hpc6: Prelude.foldr1: empty list

None of the arguments shown by 'hpc6 help markup' stands out as a clear
candidate either...

'hpc6 report --per-module MyTool' generates this:

-----<module Main>-----
 80% expressions used (386/479)
100% boolean coverage (0/0)
     100% guards (0/0)
     100% 'if' conditions (0/0)
     100% qualifiers (0/0)
100% alternatives used (0/0)
100% local declarations used (0/0)
100% top-level declarations used (17/17)

Where are my other modules???

Any and all help is appreciated.

/M
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080116/df912ece/attachment.htm


More information about the Haskell-Cafe mailing list