Cobertura is a format that can be imported into a Cobertura utility.
Procedure
- In the Code Coverage Results view, select the
result that you want to export, right-click and select Export.
The Coverage Result Export window opens. When you select multiple
results, the results are merged and then exported as a single result.
- From the Export Format drop-down list, select
Cobertura.
- Specify an empty result location:
- To export to a local directory, select Local from the
Connection list. In the Location field, type the file
path or use Browse to select a file.
- To export to a remote location, select an existing remote location from the
Connection list or use New to create one. In the
Location field, type the remote directory or use
Browse to select a directory from the remote location.
The Coverage Result Export window will
remember the destination that you specify after you complete exporting.
- Enter the result file name or use the default name.
Note: Specify the name of the result file, or leave the field
blank to stay with the default name. The file name cannot contain special characters. In addition,
avoid using the forward slash (/).
The file extension will be
automatically added based on the format that you select for exporting the results.
- Optional: Specify a directory name or a fully qualified path in the
Root field to define the root location for source files included in the code
coverage result.
- Specify a directory name to set the top-level directory for the source files.
- Specify a fully qualified path to remove the specified path from the source file
paths.
For example, if you export a result that contains source files located
at:
/home/user/projectA/programA.cbl
Then, you must specify either
"projectA" or
"/home/username" in the
Root field. The
exporter will output a code coverage result with the source file referenced using a relative
path:
projectA/programA.cbl
- Click Finish to export the results.
If the selected results contain files that have the same name but
different content, the merged result report might be inaccurate. A warning message is displayed for
you to confirm merging the results or cancel the request.
Results
When the result exporting is done, you can find the exported files in Cobertura format in the
result location that you specified.
The exported files in Cobertura format include a
.xml file of coverage report
and the source code that matches the report. For example, you can find a typical output folder
structure for the exported results in Cobertura format as below.
Root/coverageReport.xml
/src/...
coverageReport.xml is an xml file in Coloratura report format, which contains
information about covered lines. The file name can be chosen arbitrarily, as one of the arguments
for exportResult method.
src is the folder that contains source files, listings, or both.