Example #1
0
class GenerateManageXml(BaseGenerateXml):
    def __init__(self, cover_report_name, verbose, manage_path):
        super(GenerateManageXml, self).__init__(cover_report_name, verbose)
        self.using_cover = True
        from vector.apps.DataAPI.manage_api import ManageApi

        self.api = ManageApi(manage_path)

    def write_coverage_data(self):
        self.fh_data += (
            '  <combined-coverage type="complexity, %%" value="0%% (%s / 0)"/>\n'
            % self.grand_total_complexity)
        if self.coverage["statement"]:
            self.fh_data += (
                '  <combined-coverage type="statement, %%" value="%s"/>\n' %
                self.coverage["statement"])
        if self.coverage["branch"]:
            self.fh_data += (
                '  <combined-coverage type="branch, %%" value="%s"/>\n' %
                self.coverage["branch"])
        if self.coverage["mcdc"]:
            self.fh_data += (
                '  <combined-coverage type="mcdc, %%" value="%s"/>\n' %
                self.coverage["mcdc"])
        if self.coverage["basispath"]:
            self.fh_data += (
                '  <combined-coverage type="basispath, %%" value="%s"/>\n' %
                self.coverage["basispath"])
        if self.coverage["function"]:
            self.fh_data += (
                '  <combined-coverage type="function, %%" value="%s"/>\n' %
                self.coverage["function"])
        if self.coverage["functioncall"]:
            self.fh_data += (
                '  <combined-coverage type="functioncall, %%" value="%s"/>\n' %
                self.coverage["functioncall"])

    def generate_cover(self):
        self.units = self.api.project.cover_api.File.all()
        self._generate_cover(None)
        self.start_cov_file()
        self.write_coverage_data()
        self.end_cov_file()
        self.api.close()
Example #2
0
    def __init__(self, cover_report_name, verbose, manage_path):
        super(GenerateManageXml, self).__init__(cover_report_name, verbose)
        self.using_cover = True
        from vector.apps.DataAPI.manage_api import ManageApi

        self.api = ManageApi(manage_path)