How to use the gcovr.gcov.GcovParser function in gcovr

To help you get started, we’ve selected a few gcovr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gcovr / gcovr / gcovr / gcov.py View on Github external
# Return if the filename does not match the filter
    # Return if the filename matches the exclude pattern
    filtered, excluded = apply_filter_include_exclude(
        fname, options.filter, options.exclude)

    if filtered:
        logger.verbose_msg("  Filtering coverage data for file {}", fname)
        return

    if excluded:
        logger.verbose_msg("  Excluding coverage data for file {}", fname)
        return

    key = os.path.normpath(fname)

    parser = GcovParser(key, logger=logger)
    parser.parse_all_lines(
        INPUT,
        exclude_unreachable_branches=options.exclude_unreachable_branches,
        exclude_throw_branches=options.exclude_throw_branches,
        ignore_parse_errors=options.gcov_ignore_parse_errors)

    covdata.setdefault(key, FileCoverage(key)).update(parser.coverage)

    INPUT.close()