Converts lcov line coverage output to Cobertura-compatible XML for continuous integration
This project does as the name implies: it coverts code coverage report files in lcov format to Cobertura's XML report format so that CI servers like Jenkins can aggregate results and determine build stability etc.
Grab it raw and run it with python:
python lcov_cobertura.py lcov-file.dat
-b/--base-dir
- (Optional) Directory where source files are located. Defaults to the current directory-e/--excludes
- (Optional) Comma-separated list of regexes of packages to exclude-o/--output
- (Optional) Path to store cobertura xml file. Defaults to ./coverage.xml
python lcov_cobertura.py lcov.dat -b src/dir -e tests -o out.xml
You can install lcov_cobertura with pip:
pip install lcov_cobertura
Then just use it anywhere in your python:
from lcov_cobertura import LcovCobertura
LCOV_INPUT = 'SF:foo/file.ext\nDA:1,1\nDA:2,0\nend_of_record\n'
converter = LcovCobertura(LCOV_INPUT)
cobertura_xml = converter.convert()
print cobertura_xml
This project is provided under the Apache License, Version 2.0.