How to use the gcovr.version.version_str 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 / driver.py View on Github external
def main(options, args):

    if options.version:
        sys.stdout.write(
            "gcovr %s\n"
            "\n"
            "Copyright (2013) Sandia Corporation. Under the terms of Contract\n"
            "DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government\n"
            "retains certain rights in this software.\n"
            % (version_str(), )
        )
        sys.exit(0)

    if options.objdir:
        tmp = options.objdir.replace('/', os.sep).replace('\\', os.sep)
        while os.sep + os.sep in tmp:
            tmp = tmp.replace(os.sep + os.sep, os.sep)
        if normpath(options.objdir) != tmp:
            sys.stderr.write(
                "(WARNING) relative referencing in --object-directory.\n"
                "\tthis could cause strange errors when gcovr attempts to\n"
                "\tidentify the original gcc working directory.\n")
        if not os.path.exists(normpath(options.objdir)):
            sys.stderr.write(
                "(ERROR) Bad --object-directory option.\n"
                "\tThe specified directory does not exist.\n")
github gcovr / gcovr / gcovr / prints / html.py View on Github external
def _percent_uncovered(key):
        (total, covered, percent) = covdata[key].coverage(options.show_branch)
        if covered:
            return -1.0 * covered / total
        else:
            return total or 1e6

    def _alpha(key):
        return key

    details = options.html_details
    if options.output is None:
        details = False
    data = {}
    data['HEAD'] = "Head"
    data['VERSION'] = version_str()
    data['TIME'] = str(int(time()))
    data['DATE'] = date.today().isoformat()
    data['ROWS'] = []
    data['low_color'] = low_color
    data['medium_color'] = medium_color
    data['high_color'] = high_color
    data['COVERAGE_MED'] = medium_coverage
    data['COVERAGE_HIGH'] = high_coverage
    data['CSS'] = css.substitute(
        low_color=low_color, medium_color=medium_color, high_color=high_color,
        covered_color=covered_color, uncovered_color=uncovered_color
    )
    data['DIRECTORY'] = ''

    branchTotal = 0
    branchCovered = 0