diff --git a/utils/lit/lit/Test.py b/utils/lit/lit/Test.py index e51bf129776..2e0f478337b 100644 --- a/utils/lit/lit/Test.py +++ b/utils/lit/lit/Test.py @@ -1,4 +1,5 @@ import os +from xml.sax.saxutils import escape # Test result codes. @@ -194,3 +195,17 @@ class Test: return True return False + + + def getJUnitXML(self): + test_name = self.path_in_suite[-1] + test_path = self.path_in_suite[:-1] + + xml = "\n") + xunit_output_file.write("\n") + for suite_name, suite in by_suite.items(): + xunit_output_file.write("\n") + for result_test in suite['tests']: + xunit_output_file.write(result_test.getJUnitXML() + "\n") + xunit_output_file.write("\n") + xunit_output_file.write("") + xunit_output_file.close() + # If we encountered any additional errors, exit abnormally. if litConfig.numErrors: sys.stderr.write('\n%d error(s), exiting.\n' % litConfig.numErrors)