def _gen_results(self):
    '\n        The function is called after the regression has completed. It collates the\n        status of all run targets and generates a dict. It parses the testplan and\n        maps the generated result to the testplan entries to generate a final table\n        (list). It also prints the full list of failures for debug / triage. If cov\n        is enabled, then the summary coverage report is also generated. The final\n        result is in markdown format.\n        '

    def retrieve_result(name, results):
        for item in results:
            if (name == item['name']):
                return item
        return None

    def gen_results_sub(items, results, fail_msgs):
        '\n            Generate the results table from the test runs (builds are ignored).\n            The table has 3 columns - name, passing and total as a list of dicts.\n            This is populated for all tests. The number of passing and total is\n            in reference to the number of iterations or reseeds for that test.\n            This list of dicts is directly consumed by the Testplan::results_table\n            method for testplan mapping / annotation.\n            '
        for item in items:
            if (item.status == 'F'):
                fail_msgs += item.fail_msg
            if (item.target == 'run'):
                result = retrieve_result(item.name, results)
                if (result is None):
                    result = {'name': item.name, 'passing': 0, 'total': 0}
                    results.append(result)
                if (item.status == 'P'):
                    result['passing'] += 1
                result['total'] += 1
            (results, fail_msgs) = gen_results_sub(item.sub, results, fail_msgs)
        return (results, fail_msgs)
    regr_results = []
    fail_msgs = ''
    deployed_items = self.deploy
    if self.cov:
        deployed_items.append(self.cov_merge_deploy)
    (regr_results, fail_msgs) = gen_results_sub(deployed_items, regr_results, fail_msgs)
    if (fail_msgs != ''):
        fail_msgs = ('\n## List of Failures\n' + fail_msgs)
        self.errors_seen = True
    results_str = (('## ' + self.results_title) + '\n')
    results_str += (('### ' + self.timestamp_long) + '\n')
    if hasattr(self, 'testplan_doc_path'):
        testplan = ((('https://' + self.doc_server) + '/') + getattr(self, 'testplan_doc_path'))
    else:
        testplan = ((('https://' + self.doc_server) + '/') + self.rel_path)
        testplan = testplan.replace('/dv', '/doc/dv_plan/#testplan')
    results_str += (('### [Testplan](' + testplan) + ')\n')
    results_str += (('### Simulator: ' + self.tool.upper()) + '\n\n')
    if (regr_results == []):
        results_str += 'No results to display.\n'
    else:
        results_str += self.testplan.results_table(regr_results=regr_results, map_full_testplan=self.map_full_testplan)
        results_str += '\n'
        self.results_summary = self.testplan.results_summary
        if self.cov:
            if (self.cov_report_deploy.status == 'P'):
                results_str += '\n## Coverage Results\n'
                if hasattr(self, 'cov_report_page'):
                    results_str += '\n### [Coverage Dashboard]'
                    results_str += '({})\n\n'.format(getattr(self, 'cov_report_page'))
                results_str += self.cov_report_deploy.cov_results
                self.results_summary['Coverage'] = self.cov_report_deploy.cov_total
            else:
                self.results_summary['Coverage'] = '--'
        self.results_summary['Name'] = self._get_results_page_link(self.results_summary['Name'])
    self.results_md = (results_str + fail_msgs)
    results_str += fail_msgs
    results_file = (((self.scratch_path + '/results_') + self.timestamp) + '.md')
    f = open(results_file, 'w')
    f.write(self.results_md)
    f.close()
    log.info('[results page]: [%s] [%s]', self.name, results_file)
    return results_str
The function is called after the regression has completed. It collates the
status of all run targets and generates a dict. It parses the testplan and
maps the generated result to the testplan entries to generate a final table
(list). It also prints the full list of failures for debug / triage. If cov
is enabled, then the summary coverage report is also generated. The final
result is in markdown format.
def _gen_results(self):
    '\n        The function is called after the regression has completed. It collates the\n        status of all run targets and generates a dict. It parses the testplan and\n        maps the generated result to the testplan entries to generate a final table\n        (list). It also prints the full list of failures for debug / triage. If cov\n        is enabled, then the summary coverage report is also generated. The final\n        result is in markdown format.\n        '

    def retrieve_result(name, results):
        for item in results:
            if (name == item['name']):
                return item
        return None

    def gen_results_sub(items, results, fail_msgs):
        '\n            Generate the results table from the test runs (builds are ignored).\n            The table has 3 columns - name, passing and total as a list of dicts.\n            This is populated for all tests. The number of passing and total is\n            in reference to the number of iterations or reseeds for that test.\n            This list of dicts is directly consumed by the Testplan::results_table\n            method for testplan mapping / annotation.\n            '
        for item in items:
            if (item.status == 'F'):
                fail_msgs += item.fail_msg
            if (item.target == 'run'):
                result = retrieve_result(item.name, results)
                if (result is None):
                    result = {'name': item.name, 'passing': 0, 'total': 0}
                    results.append(result)
                if (item.status == 'P'):
                    result['passing'] += 1
                result['total'] += 1
            (results, fail_msgs) = gen_results_sub(item.sub, results, fail_msgs)
        return (results, fail_msgs)
    regr_results = []
    fail_msgs = 
    deployed_items = self.deploy
    if self.cov:
        deployed_items.append(self.cov_merge_deploy)
    (regr_results, fail_msgs) = gen_results_sub(deployed_items, regr_results, fail_msgs)
    if (fail_msgs != ):
        fail_msgs = ('\n## List of Failures\n' + fail_msgs)
        self.errors_seen = True
    results_str = (('## ' + self.results_title) + '\n')
    results_str += (('### ' + self.timestamp_long) + '\n')
    if hasattr(self, 'testplan_doc_path'):
        testplan = ((('https://' + self.doc_server) + '/') + getattr(self, 'testplan_doc_path'))
    else:
        testplan = ((('https://' + self.doc_server) + '/') + self.rel_path)
        testplan = testplan.replace('/dv', '/doc/dv_plan/#testplan')
    results_str += (('### [Testplan](' + testplan) + ')\n')
    results_str += (('### Simulator: ' + self.tool.upper()) + '\n\n')
    if (regr_results == []):
        results_str += 'No results to display.\n'
    else:
        results_str += self.testplan.results_table(regr_results=regr_results, map_full_testplan=self.map_full_testplan)
        results_str += '\n'
        self.results_summary = self.testplan.results_summary
        if self.cov:
            if (self.cov_report_deploy.status == 'P'):
                results_str += '\n## Coverage Results\n'
                if hasattr(self, 'cov_report_page'):
                    results_str += '\n### [Coverage Dashboard]'
                    results_str += '({})\n\n'.format(getattr(self, 'cov_report_page'))
                results_str += self.cov_report_deploy.cov_results
                self.results_summary['Coverage'] = self.cov_report_deploy.cov_total
            else:
                self.results_summary['Coverage'] = '--'
        self.results_summary['Name'] = self._get_results_page_link(self.results_summary['Name'])
    self.results_md = (results_str + fail_msgs)
    results_str += fail_msgs
    results_file = (((self.scratch_path + '/results_') + self.timestamp) + '.md')
    f = open(results_file, 'w')
    f.write(self.results_md)
    f.close()
    log.info('[results page]: [%s] [%s]', self.name, results_file)
    return results_str