flowbber.plugins.aggregators.lcov_merger

Lcov merger

Merge two or more coverage tracefiles created with lcov into one new tracefile.

Data produced

{
    "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_merger]

Usage:

[[aggregators]]
type = "lcov_merger"
id = "..."

    [aggregators.config]
    keys = ["lcov_source_1","lcov_source_2", "..."]
    allow_missing_keys = true
    rc_overrides = ["lcov_branch_coverage=1"]
    remove = ["*hello2*"]
{
    "aggregators": [
        {
            "type": "lcov_merger",
            "id": "...",
            "config": {
                "keys": ["lcov_source_1","lcov_source_2", "..."],
                "allow_missing_keys": true,
                "rc_overrides": ["lcov_branch_coverage=1"],
                "remove": ["*hello2*"]
            }
        }
    ]
}

keys

List of lcov sources.

  • Default: N/A

  • Optional: False

  • Schema:

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

allow_missing_keys

Ignore missing lcov source keys.

If True then any missing key, for example of an optional lcov source, will not trigger an aggregator failure and the aggregator will proceed with the remaining keys unaffected, unless no valid key remains (in which case you should mark the aggregator as optional). If False then any missing key will trigger an aggregator failure.

  • Default: True

  • Optional: True

  • Schema:

    schema={
        'type': 'boolean',
    },
    
  • 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

class flowbber.plugins.aggregators.lcov_merger.LcovMergerAggregator(index, type_, id_, optional=False, timeout=None, config=None)

Inheritance

Inheritance diagram of LcovMergerAggregator