This tool merges existing Clover databases to allow for combined reports to be generated.

Usage

java com.atlassian.clover.CloverMerge [OPTIONS] PARAMS [DBFILES...]

Parameters

Parameter

Description

Required

-i, --initstring <file>

Clover initstring. Clover initstring. This is the path where the new merged database will be written.

Yes.

Options

Option

Description

-d, --debug

Enable debug logging.

-s, --span interval

Specifies the span to use when reading subsequent databases to be merged. This option can be specified more than once and applies to all databases specified after the option, or until another span in specified

-u, --update interval

If specified, any existing database specified by -i will be included in the merge. If interval is specified, it is used as the span when reading the existing database.

-v, --verbose

Enable verbose logging.

API Usage

CloverMerge 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.CloverMerge;

...

String [] cliArgs = { "-i", "new.db",  "proj1.db", "proj2.db", "-s", "10s", "proj3.db" };
int result = CloverMerge.mainImpl(cliArgs);
if (result != 0) {
    // problem during instrumentation
}

Examples

java com.atlassian.clover.CloverMerge -i new.db proj1.db proj2.db

Merges proj1.db and proj2.db into the new database new.db. A span of zero seconds is used.

java com.atlassian.clover.CloverMerge -i new.db proj1.db -s 30s proj2.db proj3.db

Merges proj1.db, proj2.db and proj3.db into the new database new.db. A span of zero seconds is used for proj1.db, and a span of 30 seconds is used for proj2.db and proj3.db.

The files named coverage.dbxxxx_xxx_xxx are not db files. Please see the clover FAQ question.
You only need to merge files called coverage.db (there should be one per a directory) and not the recording files coverage.dbxxxx_xxx_xxx (there could be hundreds of these)