tools/code_coverage/coverage_utils.py
def GenerateCoverageInHtmlForComponent(self, component_name,
                                         per_component_coverage_summary,
                                         per_directory_coverage_summary):
    """Generates coverage html report for a component."""
    component_html_report_path = self.GetCoverageHtmlReportPathForComponent(
        component_name)
    component_html_report_dir = os.path.dirname(component_html_report_path)
    if not os.path.exists(component_html_report_dir):
      os.makedirs(component_html_report_dir)

    html_generator = CoverageReportHtmlGenerator(
        self.output_dir, component_html_report_path, 'Path')

    for dir_path in self.component_to_directories[component_name]:
      dir_absolute_path = GetFullPath(dir_path)
      if dir_absolute_path not in per_directory_coverage_summary:
        # Any directory without an exercised file shouldn't be included into
        # the report.
        continue

      html_generator.AddLinkToAnotherReport(
          self.GetCoverageHtmlReportPathForDirectory(dir_path),
          os.path.relpath(dir_path, self.src_root_dir),
          per_directory_coverage_summary[dir_absolute_path])

    html_generator.CreateTotalsEntry(
        per_component_coverage_summary[component_name])
    html_generator.WriteHtmlCoverageReport(self.no_component_view,
                                           self.no_file_view)
Generates coverage html report for a component.
Generates coverage html report for a component.
Generates coverage html report for a component .
def GenerateCoverageInHtmlForComponent(self, component_name,
                                         per_component_coverage_summary,
                                         per_directory_coverage_summary):
    component_html_report_path = self.GetCoverageHtmlReportPathForComponent(
        component_name)
    component_html_report_dir = os.path.dirname(component_html_report_path)
    if not os.path.exists(component_html_report_dir):
      os.makedirs(component_html_report_dir)
    html_generator = CoverageReportHtmlGenerator(
        self.output_dir, component_html_report_path, 'Path')
    for dir_path in self.component_to_directories[component_name]:
      dir_absolute_path = GetFullPath(dir_path)
      if dir_absolute_path not in per_directory_coverage_summary:
        continue
      html_generator.AddLinkToAnotherReport(
          self.GetCoverageHtmlReportPathForDirectory(dir_path),
          os.path.relpath(dir_path, self.src_root_dir),
          per_directory_coverage_summary[dir_absolute_path])
    html_generator.CreateTotalsEntry(
        per_component_coverage_summary[component_name])
    html_generator.WriteHtmlCoverageReport(self.no_component_view,
                                           self.no_file_view)
def GenerateCoverageInHtmlForComponent ( self , component_name , per_component_coverage_summary , per_directory_coverage_summary ) : component_html_report_path = self . GetCoverageHtmlReportPathForComponent ( component_name ) component_html_report_dir = os . path . dirname ( component_html_report_path ) if not os . path . exists ( component_html_report_dir ) : os . makedirs ( component_html_report_dir ) html_generator = CoverageReportHtmlGenerator ( self . output_dir , component_html_report_path , 'Path' ) for dir_path in self . component_to_directories [ component_name ] : dir_absolute_path = GetFullPath ( dir_path ) if dir_absolute_path not in per_directory_coverage_summary : continue html_generator . AddLinkToAnotherReport ( self . GetCoverageHtmlReportPathForDirectory ( dir_path ) , os . path . relpath ( dir_path , self . src_root_dir ) , per_directory_coverage_summary [ dir_absolute_path ] ) html_generator . CreateTotalsEntry ( per_component_coverage_summary [ component_name ] ) html_generator . WriteHtmlCoverageReport ( self . no_component_view , self . no_file_view )
Generates coverage html report for a component.
Generates coverage html report for a component .
"""Generates coverage html report for a component.""" # Any directory without an exercised file shouldn't be included into # the report.
self
component_name
per_component_coverage_summary
per_directory_coverage_summary