예제 #1
0
 def log(self):
     frame("%s/ %s, %s\n%s coverage with %s" %
           (os.path.relpath(os.getcwd(), thistest.homedir),
            str([no_ext(main) for main in self.drivers]), self.xfile,
            self.testcase.category.name if self.testcase.category else
            "generic", ' '.join(self.covoptions)),
           char='*').display()
예제 #2
0
    def check_expectations_over(self, source, relevance_cat, r_discharge_kdict,
                                l_discharge_kdict):
        """Process expectations for a particular SOURCE, comparing
        expected coverage marks against what is found in the xcov reports
        for this source."""

        frame("Processing UX for %s" % (source), post=0, char='~').display()

        # Source names in expectations might still contain path indications
        # when they reach here, to indicate that the path components are
        # expected to be conveyed in the gnatcov results (slocs in =report
        # outputs and report file name for =xcov outputs).

        # Report notes checks

        strans = self.report_translation_for(source)
        _Xchecker(report='test.rep',
                  xdict=self.xrnotes.get(source),
                  rxp=r_rxp_for[relevance_cat],
                  edict=self.ernotes.get(strans, KnoteDict(erNoteKinds)),
                  ren=r_ern_for[relevance_cat]).run(r_discharge_kdict)

        # Line notes checks, meaningless if we're in qualification mode

        if thistest.options.qualif_level:
            return

        strans = self.xcov_translation_for(source)
        _Xchecker(report=strans + '.xcov',
                  xdict=self.xlnotes.get(source),
                  rxp=r_lxp_for[relevance_cat],
                  edict=self.elnotes.get(strans, KnoteDict(elNoteKinds)),
                  ren=r_eln_for[relevance_cat]).run(l_discharge_kdict)
예제 #3
0
    def __process_one_test (self, qde):

        frame (text = ("report check for xfile = %s\n" % qde.xfile
                       + "drivers = %s" % str(qde.drivers)),
               char = '~').display()

        # Count the number of expected exemption regions

        xregions = 0
        for source_xrn in qde.xrnotes.values():
            for kind in xNoteKinds:
                xregions += len (source_xrn[kind])

        # We're looking at the last report produced, with the last
        # applicable xcov-level

        self.__setup_expectations(
            ntraces   = len(qde.drivers),
            xcovlevel = xcovlevel_from[os.path.basename(qde.wdir)[0:3]],
            xregions  = xregions
            )

        reports = ls (os.path.join (qde.wdir, "test.rep"))

        thistest.fail_if (
            len (reports) != 1, "expected 1 report, found %d" % len (reports))

        self.report = Tfile (reports[0], self.__process_line)

        [rpe.check () for rpe in self.rpElements]