[commit: ghc] wip/jenkins: testsuite/junit: Properly escape strings (5d4fb3d)
git at git.haskell.org
git at git.haskell.org
Mon Jul 31 20:21:14 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/jenkins
Link : http://ghc.haskell.org/trac/ghc/changeset/5d4fb3d9f7a8da40077b0ef0f8d9ce14edb8f3bb/ghc
>---------------------------------------------------------------
commit 5d4fb3d9f7a8da40077b0ef0f8d9ce14edb8f3bb
Author: Ben Gamari <ben at smart-cactus.org>
Date: Mon Jul 31 11:36:49 2017 -0400
testsuite/junit: Properly escape strings
>---------------------------------------------------------------
5d4fb3d9f7a8da40077b0ef0f8d9ce14edb8f3bb
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