diff options
author | Dan Albert <danalbert@google.com> | 2015-01-09 02:03:05 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-01-09 02:03:05 +0000 |
commit | 72fba4447fa3d85044c7bb3b235b1bb30015f26f (patch) | |
tree | 050813eb8ddd37b326ae0ea7c8275b10200be491 | |
parent | 1c957c198aab1b6d4f1ca9147f15107e96d091af (diff) | |
parent | d89931958aead6c2ef893d994db57042e870c780 (diff) | |
download | external_llvm-72fba4447fa3d85044c7bb3b235b1bb30015f26f.zip external_llvm-72fba4447fa3d85044c7bb3b235b1bb30015f26f.tar.gz external_llvm-72fba4447fa3d85044c7bb3b235b1bb30015f26f.tar.bz2 |
am d8993195: am 51670790: Merge "Don\'t allow test-suite names with . in them in xml output"
* commit 'd89931958aead6c2ef893d994db57042e870c780':
Don't allow test-suite names with . in them in xml output
-rw-r--r-- | utils/lit/lit/Test.py | 11 | ||||
-rwxr-xr-x | utils/lit/lit/main.py | 3 |
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']) + |