Home | Forums

PDFReporter

Produces a PDF summary report of Code Coverage for the given coverage database.

Usage

 java com.cenqua.clover.reporters.pdf.PDFReporter [OPTIONS] PARAMS

Params

-i, --initstring <file> The initstring of the coverage database.
-o, --outputfile <file> The file to write the report to.

Options

-t, --title <string> Report title
-b, --hidebars Don't render coverage bars.
-p, --pagesize <size> Specify the page size to render. Valid values are "Letter" and "A4". Default is "A4".
-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

PDFReporter 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.pdf.PDFReporter;
    ...
    String [] cliArgs = { "-i", "clover.db", "-o", "coverage.pdf" };
    int result = PDFReporter.mainImpl(cliArgs);
    if (result != 0) {
           // problem during report generation
    }

Examples

 java com.cenqua.clover.reporters.pdf.PDFReporter -i clover.db -o coverage.pdf

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

 java com.cenqua.clover.reporters.pdf.PDFReporter -c ElementsCoveredAsc
      -t "My Coverage" -i clover.db -o coverage.pdf

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