lcov to cobertura XML converter
This project does as the name implies: it converts 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.
Coverage metrics supported:
- Package/folder overall line and branch coverage
- Class/file overall line and branch coverage
- Functions hit
- Line and Branch hits
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
With pip:
pip install lcov_cobertura
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 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 3.8+ is supported. The last release with Python 2.x support is version 1.6.
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.
Metadata
Release files for lcov-cobertura 2.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lcov_cobertura-2.1.1.tar.gz | 31.1 kB | Without provenance | Details for lcov_cobertura-2.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lcov_cobertura-2.1.1-py3-none-any.whl | Python 3 | none | any | Details for lcov_cobertura-2.1.1-py3-none-any.whl |
Total release size: 43.4 kB
Release files / lcov_cobertura-2.1.1.tar.gz
| Download URL | lcov_cobertura-2.1.1.tar.gz |
|---|---|
| Size | 31.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
efa8e264f2bddebb7f5024e4ace12b633d9d59048bc647427d1e1b9688c8b58f
|
|
BLAKE2b-256 checksum How to use checksums |
7bd064bda2ec25aff095a1adb41fdab22bc467e63d1cc5a8c5130ac2bf444b88
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / lcov_cobertura-2.1.1-py3-none-any.whl
| Download URL | lcov_cobertura-2.1.1-py3-none-any.whl |
|---|---|
| Size | 12.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
92f8107297f6d1d7a7a0a88c6071c1ea04f862f2fe918c6ecce271573c37d8aa
|
|
BLAKE2b-256 checksum How to use checksums |
787a9b1448f18172e7034f1dcc717d804a86430cbd24fc7c38782a800bf3faae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Security for lcov-cobertura 2.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.