MCPcopy Index your code
hub / github.com/nodejs/node / JUnitTestOutput

Class JUnitTestOutput

tools/v8-json-to-junit.py:45–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43
44
45class JUnitTestOutput:
46 def __init__(self, test_suite_name):
47 self.root = ET.Element("testsuite")
48 self.root.attrib["name"] = test_suite_name
49
50 def HasRunTest(self, test_name, test_cmd, test_duration, test_failure):
51 test_case_element = ET.Element("testcase")
52 test_case_element.attrib["name"] = test_name
53 test_case_element.attrib["cmd"] = test_cmd
54 test_case_element.attrib["time"] = str(round(test_duration, 3))
55 if test_failure is not None:
56 failure_element = ET.Element("failure")
57 failure_element.text = test_failure
58 test_case_element.append(failure_element)
59 self.root.append(test_case_element)
60
61 def FinishAndWrite(self, f):
62 ET.ElementTree(self.root).write(f, "UTF-8")
63
64
65def Main():

Callers 1

MainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…