[llvm] r223549 - Fix corner cases in lit xunit for paths with dots
Chris Matthews
cmatthews5 at apple.com
Fri Dec 5 16:21:08 PST 2014
Author: cmatthews
Date: Fri Dec 5 18:21:08 2014
New Revision: 223549
URL: http://llvm.org/viewvc/llvm-project?rev=223549&view=rev
Log:
Fix corner cases in lit xunit for paths with dots
Modified:
llvm/trunk/utils/lit/lit/Test.py
Modified: llvm/trunk/utils/lit/lit/Test.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/Test.py?rev=223549&r1=223548&r2=223549&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/Test.py (original)
+++ llvm/trunk/utils/lit/lit/Test.py Fri Dec 5 18:21:08 2014
@@ -200,9 +200,16 @@ class Test:
def getJUnitXML(self):
test_name = self.path_in_suite[-1]
test_path = self.path_in_suite[:-1]
+ safe_test_path = [x.replace(".","_") for x in test_path]
safe_name = self.suite.name.replace(".","-")
- xml = "<testcase classname='" + safe_name + "." + \
- "/".join(test_path) + "'" + " name='" + test_name + "'"
+
+ if safe_test_path:
+ class_name = safe_name + "." + "/".join(safe_test_path)
+ else:
+ class_name = safe_name
+
+ xml = "<testcase classname='" + class_name + "' name='" + \
+ test_name + "'"
xml += " time='%.2f'" % (self.result.elapsed,)
if self.result.code.isFailure:
xml += ">\n\t<failure >\n" + escape(self.result.output)
More information about the llvm-commits
mailing list