def handle_output(self, result): from firehose.parsers.clanganalyzer import parse_plist if result.returncode: analysis = self._make_failed_analysis(result.sourcefile, result.timer, msgtext='Bad exit code running %s' % self.name, failureid='bad-exit-code') self.set_custom_fields(result, analysis) return analysis # Given e.g. resultdir='/tmp/tmpQW2l2B', the plist files # are an extra level deep e.g.: # '/tmp/tmpQW2l2B/2013-01-22-1/report-MlwJri.plist' self.log(self.resultdir) for plistpath in glob.glob(os.path.join(self.resultdir, '*/*.plist')): analysis = parse_plist(plistpath, file_=make_file(result.sourcefile), stats=make_stats(result.timer)) self.set_custom_fields(result, analysis) analysis.set_custom_field('plistpath', plistpath) return analysis # could there be more than one? # Not found? analysis = self._make_failed_analysis( result.sourcefile, result.timer, msgtext='Unable to locate plist file', failureid='plist-not-found') self.set_custom_fields(result, analysis) return analysis
def parse_example(self, filename): a = parse_plist(os.path.join(os.path.dirname(__file__), 'example-output/clanganalyzer', filename), file_=None, stats=None) return a
def parse_example(self, filename): a = parse_plist(os.path.join(os.path.dirname(__file__), 'example-output/clanganalyzer', filename), analyzerversion=FAKE_ANALYZER_VERSION, sut=FAKE_SUT, file_=None, stats=None) return a