aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorChris Matthews <cmatthews5@apple.com>2014-12-03 22:59:15 +0000
committerDan Albert <danalbert@google.com>2015-01-08 14:44:27 -0800
commit7f0b0a76545fe6ef4f6d34ea407f700ac3bc12bb (patch)
tree050813eb8ddd37b326ae0ea7c8275b10200be491 /utils
parentb3fc31dfed611afe5f1821810c67f422ca981355 (diff)
downloadexternal_llvm-7f0b0a76545fe6ef4f6d34ea407f700ac3bc12bb.zip
external_llvm-7f0b0a76545fe6ef4f6d34ea407f700ac3bc12bb.tar.gz
external_llvm-7f0b0a76545fe6ef4f6d34ea407f700ac3bc12bb.tar.bz2
Don't allow test-suite names with . in them in xml output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223305 91177308-0d34-0410-b5e6-96231b3b80d8 (cherry picked from commit 06a1a5f256cabe6d20cf745cd93b389815c988a9)
Diffstat (limited to 'utils')
-rw-r--r--utils/lit/lit/Test.py11
-rwxr-xr-xutils/lit/lit/main.py3
2 files changed, 8 insertions, 6 deletions
diff --git a/utils/lit/lit/Test.py b/utils/lit/lit/Test.py
index 2e0f478..b6dabe1 100644
--- a/utils/lit/lit/Test.py
+++ b/utils/lit/lit/Test.py
@@ -200,12 +200,13 @@ class Test:
def getJUnitXML(self):
test_name = self.path_in_suite[-1]
test_path = self.path_in_suite[:-1]
-
- xml = "<testcase classname='" + self.suite.name + "." + "/".join(test_path) + "'" + " name='" + test_name + "'"
+ safe_name = self.suite.name.replace(".","-")
+ xml = "<testcase classname='" + safe_name + "." + \
+ "/".join(test_path) + "'" + " name='" + test_name + "'"
xml += " time='%.2f'" % (self.result.elapsed,)
if self.result.code.isFailure:
- xml += ">\n\t<failure >\n" + escape(self.result.output)
- xml += "\n\t</failure>\n</testcase>"
+ xml += ">\n\t<failure >\n" + escape(self.result.output)
+ xml += "\n\t</failure>\n</testcase>"
else:
- xml += "/>"
+ xml += "/>"
return xml \ No newline at end of file
diff --git a/utils/lit/lit/main.py b/utils/lit/lit/main.py
index 90f724e..f2aedc9 100755
--- a/utils/lit/lit/main.py
+++ b/utils/lit/lit/main.py
@@ -444,7 +444,8 @@ def main(builtinParameters = {}):
xunit_output_file.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n")
xunit_output_file.write("<testsuites>\n")
for suite_name, suite in by_suite.items():
- xunit_output_file.write("<testsuite name='" + suite_name + "'")
+ safe_suite_name = suite_name.replace(".", "-")
+ xunit_output_file.write("<testsuite name='" + safe_suite_name + "'")
xunit_output_file.write(" tests='" + str(suite['passes'] +
suite['failures']) + "'")
xunit_output_file.write(" failures='" + str(suite['failures']) +