• Home
  • Raw
  • Download

Lines Matching +full:coverage +full:- +full:results

3 # Use of this source code is governed by a BSD-style license that can be
7 """Parse an LLVM coverage report to generate useable results."""
21 The file paths printed by llvm-cov take the form:
35 return filename.split('..')[-1].lstrip('./')
39 """Return the name of the checked-in file matching the given filename.
41 Use suffix matching to determine which checked-in files the given filename
58 """Return a dict whose keys are file names and values are coverage data.
60 Values are lists which take the form (lineno, coverage, code).
76 not_checked_in = '%' # Use this as the file name for not-checked-in files.
78 m = re.match('([a-zA-Z0-9\./_-]+):', line)
87 skip = re.match('^\s{2}-+$|^\s{2}\|.+$', line)
94 cov = None # We don't care about coverage for this line.
97 file_lines.append((linenum, cov, code.decode('utf-8', 'replace')))
104 return re.sub(r'[^a-zA-Z0-9]', '_', filename)
107 def _nanobench_json(results, properties, key): argument
108 """Return the results in JSON format like that produced by nanobench."""
110 # Copy over the properties first, then set the 'key' and 'results' keys,
115 rv['results'] = {
117 'coverage': {
123 'source_type': 'coverage',
126 } for percent, not_covered_lines, f in results
152 """Summarize the full line-by-line coverage report by file."""
164 total_lines - covered_lines,
170 """Generate useful data from a coverage report."""
173 parser.add_argument('--report', help='input file; an llvm coverage report.',
175 parser.add_argument('--nanobench', help='output file for nanobench data.')
177 '--key', metavar='key_or_value', nargs='+',
180 '--properties', metavar='key_or_value', nargs='+',
182 parser.add_argument('--linebyline',
183 help='output file for line-by-line JSON data.')
187 raise Exception('--key and --properties are required with --nanobench')
203 # Get per-file summaries.
206 # Write results.