[commit: ghc] wip/jenkins: testsuite/junit: Properly escape strings (d8dcaac)
git at git.haskell.org
git at git.haskell.org
Wed Aug 16 18:55:58 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/jenkins
Link : http://ghc.haskell.org/trac/ghc/changeset/d8dcaacbaaa7d40602eac6880626db0c6b3fb8d4/ghc
>---------------------------------------------------------------
commit d8dcaacbaaa7d40602eac6880626db0c6b3fb8d4
Author: Ben Gamari <ben at smart-cactus.org>
Date: Mon Jul 31 11:36:49 2017 -0400
testsuite/junit: Properly escape strings
>---------------------------------------------------------------
d8dcaacbaaa7d40602eac6880626db0c6b3fb8d4
testsuite/driver/junit.py | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/testsuite/driver/junit.py b/testsuite/driver/junit.py
index f9689de..4015c19 100644
--- a/testsuite/driver/junit.py
+++ b/testsuite/driver/junit.py
@@ -1,5 +1,6 @@
from datetime import datetime
import xml.etree.ElementTree as ET
+from xml.sax.saxutils import escape
def junit(t):
testsuites = ET.Element('testsuites')
@@ -18,21 +19,21 @@ def junit(t):
classname = testname,
name = way)
result = ET.SubElement(testcase, 'failure',
- type = reason,
- message = result)
+ type = 'unexpected failure',
+ message = escape(reason))
for (directory, testname, reason, way) in t.framework_failures:
testcase = ET.SubElement(testsuite, 'testcase',
classname = testname,
- name = way)
+ name = escape(way))
result = ET.SubElement(testcase, 'error',
type = "framework failure",
- message = reason)
+ message = escape(reason))
for (directory, testname, way) in t.expected_passes:
testcase = ET.SubElement(testsuite, 'testcase',
classname = testname,
- name = way)
+ name = escape(way))
return ET.ElementTree(testsuites)
More information about the ghc-commits
mailing list