[llvm] r332116 - [LIT] replace output escapes wit a cdata block
Chris Matthews via llvm-commits
llvm-commits at lists.llvm.org
Fri May 11 11:38:02 PDT 2018
Author: cmatthews
Date: Fri May 11 11:38:02 2018
New Revision: 332116
URL: http://llvm.org/viewvc/llvm-project?rev=332116&view=rev
Log:
[LIT] replace output escapes wit a cdata block
CDATA blocks don't need to have XML stuff escaped. Makes sense to wrap
output in them instead of escaping.
Modified:
llvm/trunk/utils/lit/lit/Test.py
llvm/trunk/utils/lit/tests/xunit-output.py
Modified: llvm/trunk/utils/lit/lit/Test.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/Test.py?rev=332116&r1=332115&r2=332116&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/Test.py (original)
+++ llvm/trunk/utils/lit/lit/Test.py Fri May 11 11:38:02 2018
@@ -376,9 +376,9 @@ class Test:
testcase_xml = testcase_template.format(class_name=class_name, test_name=test_name, time=elapsed_time)
fil.write(testcase_xml)
if self.result.code.isFailure:
- fil.write(u">\n\t<failure >\n")
- fil.write(escape(self.result.output))
- fil.write(u"\n\t</failure>\n</testcase>")
+ fil.write(u">\n\t<failure ><![CDATA[")
+ fil.write(self.result.output)
+ fil.write(u"]]></failure>\n</testcase>")
elif self.result.code == UNSUPPORTED:
fil.write(u">\n\t<skipped />\n</testcase>\n")
else:
Modified: llvm/trunk/utils/lit/tests/xunit-output.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/tests/xunit-output.py?rev=332116&r1=332115&r2=332116&view=diff
==============================================================================
--- llvm/trunk/utils/lit/tests/xunit-output.py (original)
+++ llvm/trunk/utils/lit/tests/xunit-output.py Fri May 11 11:38:02 2018
@@ -6,8 +6,6 @@
# CHECK: <testsuites>
# CHECK: <testsuite name='test-data' tests='1' failures='1' skipped='0'>
# CHECK: <testcase classname='test-data.test-data' name='bad&name.ini' time='{{[0-1]}}.{{[0-9]+}}'>
-# CHECK-NEXT: <failure >
-# CHECK-NEXT:& < > "
-# CHECK-NEXT:</failure>
+# CHECK-NEXT: <failure ><![CDATA[& < > "]]></failure>
# CHECK: </testsuite>
# CHECK: </testsuites>
More information about the llvm-commits
mailing list