+ <para>
+ This generates one file per Haskell module, and 4 index files,
+ hpc_index.html, hpc_index_alt.html, hpc_index_exp.html,
+ hpc_index_fun.html.
+ </para>
+ </sect2>
+
+ <sect2><title>Options for instrumenting code for coverage</title>
+ <para>
+ Turning on code coverage is easy, use the -fhpc flag.
+ Instrumented and non-instrumented can be freely mixed.
+ When compiling the Main module GHC automatically detects when there
+ is an hpc compiled file, and adds the correct initialization code.
+ </para>
+
+ </sect2>
+
+ <sect2><title>The hpc toolkit</title>
+
+ <para>
+ The hpc toolkit uses a cvs/svn/darcs-like interface, where a
+ single binary contains many function units.</para>
+<screen>
+$ hpc
+Usage: hpc COMMAND ...
+
+Commands:
+ help Display help for hpc or a single command
+Reporting Coverage:
+ report Output textual report about program coverage
+ markup Markup Haskell source with program coverage
+Processing Coverage files:
+ sum Sum multiple .tix files in a single .tix file
+ combine Combine two .tix files in a single .tix file
+ map Map a function over a single .tix file
+Coverage Overlays:
+ overlay Generate a .tix file from an overlay file
+ draft Generate draft overlay that provides 100% coverage
+Others:
+ show Show .tix file in readable, verbose format
+ version Display version for hpc
+</screen>
+
+ <para>In general, these options act on .tix file after an
+ instrumented binary has generated it, which hpc acting as a
+ conduit between the raw .tix file, and the more detailed reports
+ produced.
+ </para>
+
+ <para>
+ The hpc tool assumes you are in the top-level directory of
+ the location where you built your application, and the .tix
+ file is in the same top-level directory. You can use the
+ flag --srcdir to use hpc for any other directory, and use
+ --srcdir multiple times to analyse programs compiled from
+ difference locations, as is typical for packages.
+ </para>
+
+ <para>
+ We now explain in more details the major modes of hpc.
+ </para>
+
+ <sect3><title>hpc report</title>
+ <para>hpc report gives a textual report of coverage. By default,
+ all modules and packages are considered in generating report,
+ unless include or exclude are used. The report is a summary
+ unless the --per-module flag is used. The --xml-output option
+ allows for tools to use hpc to glean coverage.
+ </para>
+<screen>
+$ hpc help report
+Usage: hpc report [OPTION] .. <TIX_FILE> [<MODULE> [<MODULE> ..]]
+
+Options:
+
+ --per-module show module level detail
+ --decl-list show unused decls
+ --exclude=[PACKAGE:][MODULE] exclude MODULE and/or PACKAGE
+ --include=[PACKAGE:][MODULE] include MODULE and/or PACKAGE
+ --srcdir=DIR path to source directory of .hs files
+ multi-use of srcdir possible
+ --hpcdir=DIR sub-directory that contains .mix files
+ default .hpc [rarely used]
+ --xml-output show output in XML
+</screen>
+ </sect3>
+ <sect3><title>hpc markup</title>
+ <para>hpc markup marks up source files into colored html.
+ </para>
+<screen>
+$ hpc help markup
+Usage: hpc markup [OPTION] .. <TIX_FILE> [<MODULE> [<MODULE> ..]]
+
+Options:
+
+ --exclude=[PACKAGE:][MODULE] exclude MODULE and/or PACKAGE
+ --include=[PACKAGE:][MODULE] include MODULE and/or PACKAGE
+ --srcdir=DIR path to source directory of .hs files
+ multi-use of srcdir possible
+ --hpcdir=DIR sub-directory that contains .mix files
+ default .hpc [rarely used]
+ --fun-entry-count show top-level function entry counts
+ --highlight-covered highlight covered code, rather that code gaps
+ --destdir=DIR path to write output to
+</screen>
+
+ </sect3>
+ <sect3><title>hpc sum</title>
+ <para>hpc sum adds together any number of .tix files into a single
+ .tix file. hpc sum does not change the original .tix file; it generates a new .tix file.
+ </para>
+<screen>
+$ hpc help sum
+Usage: hpc sum [OPTION] .. <TIX_FILE> [<TIX_FILE> [<TIX_FILE> ..]]
+Sum multiple .tix files in a single .tix file
+
+Options: