flowbber.plugins.sources.lcov

Lcov

This source calls lcov on a specified directory to generate a tracefile or loads one directly, and process it with lcov_cobertura to create a standard Cobertura XML file, which in turn is then parsed using the flowbber Cobertura source.

Note

This source requires the lcov executable to be available in your system to run.

Data collected:

{
    "files": {
        "my_source_code.c": {
            "total_statements": 40,
            "total_misses": 20,
            "branch_rate": 0.5,
            "total_hits": 8,
            "line_rate": 0.5
        },
        "another_source.c": {
            "total_statements": 40,
            "total_misses": 40,
            "branch_rate": 0.5,
            "total_hits": 8,
            "line_rate": 0.0
        }
    },
    "total": {
        "total_statements": 80,
        "total_misses": 20,
        "line_rate": 0.75
    },
    "tracefile": "<path-to-tracefile.info>"
}

Dependencies:

pip3 install flowbber[lcov]

Usage:

[[sources]]
type = "lcov"
id = "..."

    [sources.config]
    source = "{pipeline.dir}"
    rc_overrides = ["lcov_branch_coverage=1"]
    remove = ["*hello2*"]
{
    "sources": [
        {
            "type": "lcov",
            "id": "...",
            "config": {
                "source": "{pipeline.dir}",
                "rc_overrides": ["lcov_branch_coverage=1"],
                "remove": ["*hello2*"]
            }
        }
    ]
}

source

Path to the directory containing gcov’s .gcda files or path to a tracefile .info file.

  • Default: N/A

  • Optional: False

  • Schema:

    {
        'type': 'string',
        'empty': False
    }
    
  • Secret: False

rc_overrides

Override lcov configuration file settings.

Elements should have the form SETTING=VALUE.

  • Default: []

  • Optional: False

  • Schema:

    {
        'type': 'list',
        'schema': {
            'type': 'string',
            'empty': False
        },
    }
    
  • Secret: False

remove

List of patterns of files to remove from coverage computation.

Patterns will be interpreted as shell wild‐card patterns.

  • Default: []

  • Optional: True

  • Schema:

    {
        'type': 'list',
        'schema': {
            'type': 'string',
            'empty': False,
        },
    }
    
  • Secret: False

Classes

  • LcovSource: Main base class to implement a Source.
class flowbber.plugins.sources.lcov.LcovSource(index, type_, id_, optional=False, timeout=None, config=None)

Inheritance

Inheritance diagram of LcovSource