アトラシアン コミュニティをご利用ください。


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


 java com.atlassian.clover.reporters.xml.XMLReporter [OPTIONS] PARAMS

Note: in Clover 3.1.x and older a class was named com.cenqua.clover.reporters.xml.XMLReporter.


-i, --initstring <file>

The initstring of the coverage database.

-o, --outfile <file>

The file to write XML output to.


-a, --alwaysreport

Forces a report to be generated, even if there is no coverage data. Defaults to 'false', i.e. a report with no coverage will abort generation.

-d, --debug

Switch logging level to debug.

-f, --filter <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.

-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'.

-l, --lineinfo

Include source-level coverage info.

-s, --span <interval>

Specifies how far back in time to include coverage recordings from. . See Using Spans. Default includes "all coverage data found".

-si, --showinnerSince 3.2.0: Show inner functions in the report (like a lambda function inside a method).
-sl, --showlambdaSince 3.2.0: Show lambda functions in the report.
-tc, --threadcount <int>Number of additional threads to be allocated to report generation. Default is 0.

-t, --title <string>

Report title.

-v, --verbose

Switch logging level to verbose.

Return code

@since Clover 3.1.12: The XMLReporter.main() calls System.exit() and returns non-zero return code in case of error during  XML report generation.

API Usage

XMLReporter 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.xml.XMLReporter;

public class XmlReportRunner {
    public void runReport() {
        String [] cliArgs = { "-i", "clover.db", "-o", "clover.xml" };
        int result = XMLReporter.runReport(cliArgs);
        if (result != 0) {
            // problem during report generation

 java com.atlassian.clover.reporters.xml.XMLReporter -i clover.db -o coverage.xml

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


java com.atlassian.clover.reporters.xml.XMLReporter -l -t "My Coverage" -i clover.db -o coverage.xml

Produce the same report as above, but include source-level coverage information, and a report title.

最終更新日: 2013 年 10 月 22 日


Powered by Confluence and Scroll Viewport.