diff options
author | Chris Matthews <cmatthews5@apple.com> | 2014-12-06 00:21:08 +0000 |
---|---|---|
committer | Chris Matthews <cmatthews5@apple.com> | 2014-12-06 00:21:08 +0000 |
commit | 8a7c194bc7e64c89007e05dd2008e20cda0969a4 (patch) | |
tree | 98aeefad35f154572d4ca5414fe11af564fc6b96 /llvm/utils/lit | |
parent | 00cdc98b7f58149577fee51acccf540f2742b62b (diff) | |
download | bcm5719-llvm-8a7c194bc7e64c89007e05dd2008e20cda0969a4.tar.gz bcm5719-llvm-8a7c194bc7e64c89007e05dd2008e20cda0969a4.zip |
Fix corner cases in lit xunit for paths with dots
llvm-svn: 223549
Diffstat (limited to 'llvm/utils/lit')
-rw-r--r-- | llvm/utils/lit/lit/Test.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/utils/lit/lit/Test.py b/llvm/utils/lit/lit/Test.py index b6dabe16f44..7f5d4117bab 100644 --- a/llvm/utils/lit/lit/Test.py +++ b/llvm/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) |