aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2015-01-08 23:38:28 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-01-08 23:38:28 +0000
commit04092cf98d875585f3b6ece0b7e71f2b3a2d3b97 (patch)
tree3fcf4b6ac4093a3036cbe3185a63cb6a1417bd5f
parent2ee64e38ab63e8d94fcdbceba954b35c605bd83e (diff)
parent30895fdbcdbee22f04395be19d2835aebbe98e3b (diff)
downloadexternal_llvm-04092cf98d875585f3b6ece0b7e71f2b3a2d3b97.zip
external_llvm-04092cf98d875585f3b6ece0b7e71f2b3a2d3b97.tar.gz
external_llvm-04092cf98d875585f3b6ece0b7e71f2b3a2d3b97.tar.bz2
Merge "Fix corner cases in lit xunit for paths with dots"
-rw-r--r--utils/lit/lit/Test.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/utils/lit/lit/Test.py b/utils/lit/lit/Test.py
index b6dabe1..7f5d411 100644
--- a/utils/lit/lit/Test.py
+++ b/utils/lit/lit/Test.py
@@ -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)