Home | Forums

HtmlReporter

Produces an HTML report of Code Coverage for the given coverage database.

Usage

 java com.cenqua.clover.reporters.html.HtmlReporter [OPTIONS] PARAMS

Params

-i, --initstring <file> The initstring of the coverage database.
-o, --outputdir <dir> The directory to write the report to. Will be created if it doesn't exist.

Options

-t, --title <string> Report title
-bw Don't colour syntax-hilight source - smaller html output.
-h, --hidesrc Don't render source level coverage.
-p, --sourcepath <path> The source path to search when looking for source files.
-b, --hidebars Don't render coverage bars.
-tw, --tabwidth <int> The number of spaces to subsitute TAB characters with. Defaults to 4.
-c, --orderby <compname> comparator to use when listing packages and classes. Default is PcCoveredAsc. valid values are
Alpha
Alpabetical.
PcCoveredAsc
Percent total coverage, ascending.
PcCoveredDesc
Percent total coverage, descending.
ElementsCoveredAsc
Total elements covered, ascending
ElementsCoveredDesc
Total elements covered, descending
ElementsUncoveredAsc
Total elements uncovered, ascending
ElementsUncoveredDesc
Total elements uncovered, descending
-l, --ignore <string> Comma or space separated list of contexts to ignore when generating coverage reports. Most useful one is "catch". valid values are "assert", "static", "instance", "constructor", "method", "switch", "while", "do", "for", "if", "else", "try", "catch", "finally", "sync", or the name of a user-defined Context. See Using Contexts
-s, --span <interval> Specifies how far back in time to include coverage recordings from since the last Clover build. See Using Spans. Defaults to 0 seconds.
-d, --debug Switch logging level to debug
-v, --verbose Switch logging level to verbose

API Usage

HtmlReporter provides a simple API that accepts an array of strings representing the command line arguments and returns an integer result code. The following fragment illustrates use of the API:

 import com.cenqua.clover.reporters.html.HtmlReporter;
    ...
    String [] cliArgs = { "-i", "clover.db", "-o", "clover_html" };
    int result = HtmlReporter.mainImpl(cliArgs);
    if (result != 0) {
           // problem during report generation
    }

Examples

 java com.cenqua.clover.reporters.html.HtmlReporter -i clover.db -o clover_html

Read coverage for the Clover database "clover.db", and produce a report in the directory "clover_html"

 java com.cenqua.clover.reporters.html.HtmlReporter -c ElementsCoveredAsc
      -t "My Coverage" -i clover.db -o clover_html

Produce the same report as above, but include a report title, and order lists by total elements covered rather than percentage covered.