tools/code_coverage/coverage_utils.py
def GeneratePerFileCoverageSummary(self):
    """Generate per file coverage summary using coverage data in JSON format."""
    files_coverage_data = self.summary_data['data'][0]['files']

    per_file_coverage_summary = {}
    for file_coverage_data in files_coverage_data:
      file_path = os.path.normpath(file_coverage_data['filename'])
      assert file_path.startswith(self.src_root_dir), (
          'File path "%s" in coverage summary is outside source checkout.' %
          file_path)

      summary = file_coverage_data['summary']
      if summary['lines']['count'] == 0:
        continue

      per_file_coverage_summary[file_path] = CoverageSummary(
          regions_total=summary['regions']['count'],
          regions_covered=summary['regions']['covered'],
          functions_total=summary['functions']['count'],
          functions_covered=summary['functions']['covered'],
          lines_total=summary['lines']['count'],
          lines_covered=summary['lines']['covered'])

    logging.debug('Finished generating per-file code coverage summary.')
    return per_file_coverage_summary
Generate per file coverage summary using coverage data in JSON format.
Generate per file coverage summary using coverage data in JSON format.
Generate per file coverage summary using coverage data in JSON format .
def GeneratePerFileCoverageSummary(self):
    files_coverage_data = self.summary_data['data'][0]['files']
    per_file_coverage_summary = {}
    for file_coverage_data in files_coverage_data:
      file_path = os.path.normpath(file_coverage_data['filename'])
      assert file_path.startswith(self.src_root_dir), (
          'File path "%s" in coverage summary is outside source checkout.' %
          file_path)
      summary = file_coverage_data['summary']
      if summary['lines']['count'] == 0:
        continue
      per_file_coverage_summary[file_path] = CoverageSummary(
          regions_total=summary['regions']['count'],
          regions_covered=summary['regions']['covered'],
          functions_total=summary['functions']['count'],
          functions_covered=summary['functions']['covered'],
          lines_total=summary['lines']['count'],
          lines_covered=summary['lines']['covered'])
    logging.debug('Finished generating per-file code coverage summary.')
    return per_file_coverage_summary
def GeneratePerFileCoverageSummary ( self ) : files_coverage_data = self . summary_data [ 'data' ] [ 0 ] [ 'files' ] per_file_coverage_summary = { } for file_coverage_data in files_coverage_data : file_path = os . path . normpath ( file_coverage_data [ 'filename' ] ) assert file_path . startswith ( self . src_root_dir ) , ( 'File path "%s" in coverage summary is outside source checkout.' % file_path ) summary = file_coverage_data [ 'summary' ] if summary [ 'lines' ] [ 'count' ] == 0 : continue per_file_coverage_summary [ file_path ] = CoverageSummary ( regions_total = summary [ 'regions' ] [ 'count' ] , regions_covered = summary [ 'regions' ] [ 'covered' ] , functions_total = summary [ 'functions' ] [ 'count' ] , functions_covered = summary [ 'functions' ] [ 'covered' ] , lines_total = summary [ 'lines' ] [ 'count' ] , lines_covered = summary [ 'lines' ] [ 'covered' ] ) logging . debug ( 'Finished generating per-file code coverage summary.' ) return per_file_coverage_summary
Generate per file coverage summary using coverage data in JSON format.
Generate per file coverage summary using coverage data in JSON format .
"""Generate per file coverage summary using coverage data in JSON format."""
self