def dump_kit_consistency_log (self): announce ("dumping consistency log - format agnostic") logfile = os.path.join(self.workdir, "consistency.log") log = open (logfile, 'w') log.write ( "artifact tree at %s (%s)\n" % ( self.repodir, treeref_at(self.repodir)) ) log.write ( "designated testsuite tree at %s (%s)\n" % \ (self.o.testsuite_dir, "REMOTE" if raccess_in(self.o.testsuite_dir) else "local") ) log.write ( "local testsuite tree at %s\n" % self.local_testsuite_dir) suite_ctxdata = jload_from ( os.path.join (self.local_testsuite_dir, CTXDATA_FILE)) self.__dump_tree_consistency_info (log, suite_ctxdata) self.__dump_version_consistency_info (log, suite_ctxdata) self.__dump_tr_consistency_info (log) log.close() print "consistency log available at %s" % logfile
def __init__(self, options): self.o = options # Fetch the testsuite execution context self.suitedata = dutils.jload_from( os.path.join(self.o.testsuite_dir, CTXDATA_FILE)) # Pick the testsuite dolevel if none was provided. Check # consistency otherwise: suite_dolevel = self.suitedata['options']['dolevel'] fail_if( not suite_dolevel, "Testsuite at %s was not run in qualification mode" % (self.o.testsuite_dir)) if self.o.dolevel is None: self.o.dolevel = suite_dolevel else: fail_if( self.o.dolevel != suite_dolevel, "explicit dolevel (%s) doesn't match testsuite (%s)" % (self.o.dolevel, suite_dolevel)) # Setup the list of violation counters we care about wrt the # targetted do-level: self.viocnt_columns = viocnt_columns_for[self.o.dolevel] # Fetch the test results: qdreg = QualificationDataRepository(testsuite_dir=self.o.testsuite_dir) self.qdl = sorted(qdreg.qdl, key=lambda qd: qd.tcid) self.rstf = None # All the parts of our report get structured with sections # based on test categories. We distinguish language specific # categories from common ones. lang_categories = [ (Category(lang=lang, name="%s STATEMENT Coverage" % lang, matcher="%s/%s/stmt" % (QROOTDIR, lang)), Category(lang=lang, name="%s DECISION Coverage" % lang, matcher="%s/%s/decision" % (QROOTDIR, lang)), Category(lang=lang, name="%s MCDC Coverage" % lang, matcher="%s/%s/mcdc" % (QROOTDIR, lang))) for lang in QLANGUAGES ] lang_categories = [ cat for lang_cats in lang_categories for cat in lang_cats ] other_categories = [ Category(name="REPORT Format", matcher="%s/Common/Report" % QROOTDIR), Category(name="Testsuite Selftest", matcher="%s/Appendix/Testsuite" % QROOTDIR, internal=True), Category(name="Others", matcher=".") ] self.categories = lang_categories + other_categories [self.categorize(qda) for qda in self.qdl] # Compute the set of languages for which tests have matched (that is, # were run). This is useful e.g. to decide which sets of compilation # options should be displayed in the environment description items. self.languages = set([cat.lang for cat in lang_categories if cat.qdl]) self.gen_envinfo(sepfile="env.rst") # Then compute the tables and summaries of test status counters self.compute_tcdata() self.gen_tctables(sepfile="tctables.rst") self.gen_tssummary(sepfile="tssummary.rst")