diff options
author | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2011-02-02 00:49:33 +0000 |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2011-02-02 00:49:33 +0000 |
commit | 9bcf4d0a654b27732e2fa901fe98c09aba71773a (patch) | |
tree | d2072cc7bdd2f9df2f35f85258d8c0e10e80691a /test/gtest_xml_test_utils.py | |
parent | c8efea670544c86a169f920c567a9dae86227e95 (diff) | |
download | googletest-9bcf4d0a654b27732e2fa901fe98c09aba71773a.tar.gz googletest-9bcf4d0a654b27732e2fa901fe98c09aba71773a.tar.bz2 googletest-9bcf4d0a654b27732e2fa901fe98c09aba71773a.zip |
Adds type_param and value_param as <testcase> attributes to the XML
report; also removes the comment() and test_case_comment() fields of
TestInfo. Proposed and initally implemented by Joey Oravec.
Re-implemented by Vlad Losev.
Diffstat (limited to 'test/gtest_xml_test_utils.py')
-rwxr-xr-x | test/gtest_xml_test_utils.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/gtest_xml_test_utils.py b/test/gtest_xml_test_utils.py index c83c3b7e..0f55c164 100755 --- a/test/gtest_xml_test_utils.py +++ b/test/gtest_xml_test_utils.py @@ -58,8 +58,9 @@ class GTestXMLTestCase(gtest_test_utils.TestCase): * It has the same tag name as expected_node. * It has the same set of attributes as expected_node, each with the same value as the corresponding attribute of expected_node. - An exception is any attribute named "time", which needs only be - convertible to a floating-point number. + Exceptions are any attribute named "time", which needs only be + convertible to a floating-point number and any attribute named + "type_param" which only has to be non-empty. * It has an equivalent set of child nodes (including elements and CDATA sections) as expected_node. Note that we ignore the order of the children as they are not guaranteed to be in any @@ -150,6 +151,9 @@ class GTestXMLTestCase(gtest_test_utils.TestCase): * The "time" attribute of <testsuites>, <testsuite> and <testcase> elements is replaced with a single asterisk, if it contains only digit characters. + * The "type_param" attribute of <testcase> elements is replaced with a + single asterisk (if it sn non-empty) as it is the type name returned + by the compiler and is platform dependent. * The line number reported in the first line of the "message" attribute of <failure> elements is replaced with a single asterisk. * The directory names in file paths are removed. @@ -159,6 +163,9 @@ class GTestXMLTestCase(gtest_test_utils.TestCase): if element.tagName in ("testsuites", "testsuite", "testcase"): time = element.getAttributeNode("time") time.value = re.sub(r"^\d+(\.\d+)?$", "*", time.value) + type_param = element.getAttributeNode("type_param") + if type_param and type_param.value: + type_param.value = "*" elif element.tagName == "failure": for child in element.childNodes: if child.nodeType == Node.CDATA_SECTION_NODE: |