def testAddEdge(self): signal = FailureSignal() signal.AddEdge({ 'rule': "CXX", 'output_nodes': ['b.o'], 'dependencies': ['b.h'] }) signal.AddEdge({ 'rule': "CXX", 'output_nodes': ['a.o', 'aa.o'], 'dependencies': ['a.h', 'a.c'] }) signal.AddEdge({ 'rule': "CXX", 'output_nodes': ['a.o', 'aa.o'], 'dependencies': ['a.h', 'a.c'] }) self.assertEqual([{ "rule": 'CXX', "output_nodes": ['b.o'], 'dependencies': ['b.h'] }, { 'rule': 'CXX', 'output_nodes': ['a.o', 'aa.o'], 'dependencies': ['a.h', 'a.c'] }], signal.failed_edges)
def _ExtractNinjaOutputJson(self, ninja_output, bot_name, master_name): signal = FailureSignal() strict_regex = waterfall_config.EnableStrictRegexForCompileLinkFailures( master_name, bot_name) failed_output_nodes = [] for failure in ninja_output['failures']: lines = failure['output'].splitlines() del failure['output'] failure['dependencies'] = map(extractor_util.NormalizeFilePath, failure['dependencies']) signal.AddEdge(failure) if lines: if strict_regex: self.ExtractFailedOutputNodes(lines[0], signal) else: self.GetFailedTarget(lines[0], signal) for line in lines[1:]: self.ExtractFiles(line, signal) failed_output_nodes.extend(failure['output_nodes']) signal.failed_output_nodes = sorted(set(failed_output_nodes)) return signal