tools/code_coverage/coverage_utils.py
def GenerateCoverageInHtmlForDirectory(self, dir_path,
                                         per_directory_coverage_summary,
                                         per_file_coverage_summary):
    """Generates coverage html report for a single directory."""
    html_generator = CoverageReportHtmlGenerator(
        self.output_dir, self.GetCoverageHtmlReportPathForDirectory(dir_path),
        'Path')

    for entry_name in os.listdir(self._MapToLocal(dir_path)):
      entry_path = os.path.normpath(os.path.join(dir_path, entry_name))

      if entry_path in per_file_coverage_summary:
        entry_html_report_path = self.GetCoverageHtmlReportPathForFile(
            entry_path)
        entry_coverage_summary = per_file_coverage_summary[entry_path]
      elif entry_path in per_directory_coverage_summary:
        entry_html_report_path = self.GetCoverageHtmlReportPathForDirectory(
            entry_path)
        entry_coverage_summary = per_directory_coverage_summary[entry_path]
      else:
        # Any file without executable lines shouldn't be included into the
        # report. For example, OWNER and README.md files.
        continue

      html_generator.AddLinkToAnotherReport(entry_html_report_path,
                                            os.path.basename(entry_path),
                                            entry_coverage_summary)

    html_generator.CreateTotalsEntry(per_directory_coverage_summary[dir_path])
    html_generator.WriteHtmlCoverageReport(self.no_component_view,
                                           self.no_file_view)
Generates coverage html report for a single directory.
Generates coverage html report for a single directory.
Generates coverage html report for a single directory .
def GenerateCoverageInHtmlForDirectory(self, dir_path,
                                         per_directory_coverage_summary,
                                         per_file_coverage_summary):
    html_generator = CoverageReportHtmlGenerator(
        self.output_dir, self.GetCoverageHtmlReportPathForDirectory(dir_path),
        'Path')
    for entry_name in os.listdir(self._MapToLocal(dir_path)):
      entry_path = os.path.normpath(os.path.join(dir_path, entry_name))
      if entry_path in per_file_coverage_summary:
        entry_html_report_path = self.GetCoverageHtmlReportPathForFile(
            entry_path)
        entry_coverage_summary = per_file_coverage_summary[entry_path]
      elif entry_path in per_directory_coverage_summary:
        entry_html_report_path = self.GetCoverageHtmlReportPathForDirectory(
            entry_path)
        entry_coverage_summary = per_directory_coverage_summary[entry_path]
      else:
        continue
      html_generator.AddLinkToAnotherReport(entry_html_report_path,
                                            os.path.basename(entry_path),
                                            entry_coverage_summary)
    html_generator.CreateTotalsEntry(per_directory_coverage_summary[dir_path])
    html_generator.WriteHtmlCoverageReport(self.no_component_view,
                                           self.no_file_view)
def GenerateCoverageInHtmlForDirectory ( self , dir_path , per_directory_coverage_summary , per_file_coverage_summary ) : html_generator = CoverageReportHtmlGenerator ( self . output_dir , self . GetCoverageHtmlReportPathForDirectory ( dir_path ) , 'Path' ) for entry_name in os . listdir ( self . _MapToLocal ( dir_path ) ) : entry_path = os . path . normpath ( os . path . join ( dir_path , entry_name ) ) if entry_path in per_file_coverage_summary : entry_html_report_path = self . GetCoverageHtmlReportPathForFile ( entry_path ) entry_coverage_summary = per_file_coverage_summary [ entry_path ] elif entry_path in per_directory_coverage_summary : entry_html_report_path = self . GetCoverageHtmlReportPathForDirectory ( entry_path ) entry_coverage_summary = per_directory_coverage_summary [ entry_path ] else : continue html_generator . AddLinkToAnotherReport ( entry_html_report_path , os . path . basename ( entry_path ) , entry_coverage_summary ) html_generator . CreateTotalsEntry ( per_directory_coverage_summary [ dir_path ] ) html_generator . WriteHtmlCoverageReport ( self . no_component_view , self . no_file_view )
Generates coverage html report for a single directory.
Generates coverage html report for a single directory .
"""Generates coverage html report for a single directory.""" # Any file without executable lines shouldn't be included into the # report. For example, OWNER and README.md files.
self
dir_path
per_directory_coverage_summary
per_file_coverage_summary