aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2015-01-09 01:56:28 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-01-09 01:56:28 +0000
commitd89931958aead6c2ef893d994db57042e870c780 (patch)
tree050813eb8ddd37b326ae0ea7c8275b10200be491
parent23910ec0b0880243bf3733504c8308b304a2bdd3 (diff)
parent51670790ca5704c9dad0ff202ce905b0fea97f47 (diff)
downloadexternal_llvm-d89931958aead6c2ef893d994db57042e870c780.zip
external_llvm-d89931958aead6c2ef893d994db57042e870c780.tar.gz
external_llvm-d89931958aead6c2ef893d994db57042e870c780.tar.bz2
am 51670790: Merge "Don\'t allow test-suite names with . in them in xml output"
* commit '51670790ca5704c9dad0ff202ce905b0fea97f47': Don't allow test-suite names with . in them in xml output
-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']) +