ConsoleReporter


Added by Edwin Dawson [Atlassian], last edited by Edwin Dawson [Atlassian] on Jan 10, 2008

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
Clover 2.0 Documentation

Index

Reports Code Coverage for the given coverage database to the console.

Usage

java com.cenqua.clover.reporters.console.ConsoleReporter [OPTIONS] PARAMS

Params

-i, --initstring <file> The initstring of the coverage database.

Options

-t, --title <string> Report title
-l, --level <string> The level of detail to report. Valid values are "summary", "class", "method", "statement". Default value is "summary".
-p, --sourcepath <path> The source path to search when looking for source files.
-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

ConsoleReporter 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.console.ConsoleReporter;

    ...

    String [] cliArgs = { "-l", "method", "-t", "Method Coverage", "-i", "clover.db" };
    int result = ConsoleReporter.mainImpl(cliArgs);
    if (result != 0) {
           // problem during report generation
    }

Examples

java com.cenqua.clover.reporters.console.ConsoleReporter -i clover.db

Reads coverage for the Clover database "clover.db", and produces a summary report to the console.

java com.cenqua.clover.reporters.console.ConsoleReporter -l "method" -t "Method Coverage" -i clover.db

Produces the same report as above, but includes method-level coverage information, and a report title.