Produces a PDF summary report of Code Coverage for the given coverage database.
java com.atlassian.clover.reporters.pdf.PDFReporter [OPTIONS] PARAMS
Note: in Clover 3.1.x and older a class was named com.cenqua.clover.reporters.pdf.PDFReporter.
-i, --initstring <file> | The initstring of the coverage database. |
-o, --outfile <file> | The file to write the report to. Note: In Clover 3.1.x and older the longer option was named '--outputfile' |
-a, --alwaysreport | Forces a report to be generated, even if there is no coverage data. Defaults to ' |
-b, --hidebars | Don't render coverage bars. |
-c, --orderby <compname> | Comparator to use when listing packages and classes. Default is PcCoveredAsc.
|
-d, --debug | Switch logging level to debug |
-e, --showempty | Show classes/packages even if they don't have any statements, methods or conditionals. default is false. |
-f, --filter <string> | Comma or space separated list of contexts to ignore when generating coverage reports. Most useful one is "catch". |
-if --includefailcoverage | Specifies whether or not to include coverage attributed to a test that has failed. If omitted, failed test coverage is not included. Default setting is 'false'. |
-p, --pagesize <size> | Specify the page size to render. Valid values are "Letter" and "A4". Default is "A4". |
-s, --span <interval> | Specifies how far back in time to include coverage recordings from. See Using Spans. Default includes all coverage data found. |
-t, --title <string> | Report title |
-tc, --threadcount <int> | Number of additional threads to be allocated to report generation. Default is 0. |
-v, --verbose | Switch logging level to verbose |
The PDFReporter.main() calls System.exit() and returns non-zero return code in case of error during PDF report generation.
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.atlassian.clover.CloverStartup; import com.atlassian.clover.Logger; import com.atlassian.clover.reporters.pdf.PDFReporter; public class PdfReportRunner { public void runReport() { CloverStartup.loadLicense(Logger.getInstance()); String [] cliArgs = { "-i", "clover.db", "-o", "clover.pdf" }; int result = PDFReporter.runReport(cliArgs); if (result != 0) { // problem during report generation } } }
java com.atlassian.clover.reporters.pdf.PDFReporter -i clover.db -o coverage.pdf
Reads coverage for the Clover database "clover.db", and produces a pdf report in the file "coverage.pdf".
java com.atlassian.clover.reporters.pdf.PDFReporter -c ElementsCoveredAsc -t "My Coverage" -i clover.db -o coverage.pdf
Produces the same report as above, but includes a report title, and orders lists by total elements covered rather than percentage covered.