test for lcov to cobertura XML converter
Quick usage
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 -
-d/--demangle
- (Optional) Demangle C++ function names. Requires c++filt
python lcov_cobertura.py lcov-file.dat --base-dir src/dir --excludes test.lib --output build/coverage.xml --demangle
pip:
Withpip install lcov_cobertura_fix
Command-line usage
lcov_cobertura 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 -
-d/--demangle
- (Optional) Demangle C++ function names. Requires c++filt
lcov_cobertura_fix lcov-file.dat --base-dir src/dir --excludes test.lib --output build/coverage.xml --demangle
Usage as a Python module
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)
Environment Support
Python 2.6+ is supported (including Python 3). You can also use the experimental Jython 2.5 friendly version in the jython branch.
Contributions
This project is made possible due to the efforts of these fine people:
License
This project is provided under the Apache License, Version 2.0.
I provide this software free of charge. If you find it helpful, please endorse me for Python on coderwall:
#Uninstall the software #step 1 cat >> files.txt << EOF /usr/local/lib/python2.7/dist-packages/lcov_cobertura-1.6-py2.7.egg /usr/local/bin/lcov_cobertura EOF #step 2 tr '\n' '\0' < files.txt | xargs -0 sudo rm -f --