aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Matthews <cmatthews5@apple.com>2014-12-06 00:21:08 +0000
committerDan Albert <danalbert@google.com>2015-01-08 14:44:27 -0800
commit30895fdbcdbee22f04395be19d2835aebbe98e3b (patch)
tree3fcf4b6ac4093a3036cbe3185a63cb6a1417bd5f
parentd88eccd6c70588c96cfbe6beb286527cbfb3b2f0 (diff)
downloadexternal_llvm-30895fdbcdbee22f04395be19d2835aebbe98e3b.zip
external_llvm-30895fdbcdbee22f04395be19d2835aebbe98e3b.tar.gz
external_llvm-30895fdbcdbee22f04395be19d2835aebbe98e3b.tar.bz2
Fix corner cases in lit xunit for paths with dots
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223549 91177308-0d34-0410-b5e6-96231b3b80d8 (cherry picked from commit 689f10d1b56f68fafd999debc86e0b58d2d5de80)
-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)