- 3.0.1 core module.
gtest_xml_test_utils.GTestXMLTestCase Class Reference
Inheritance diagram for gtest_xml_test_utils.GTestXMLTestCase:
gtest_xml_outfiles_test.GTestXMLOutFilesTest gtest_xml_output_unittest.GTestXMLOutputUnitTest

Public Member Functions

def AssertEquivalentNodes (self, expected_node, actual_node)
 
def NormalizeXml (self, element)
 

Static Public Attributes

dictionary identifying_attribute
 

Detailed Description

Base class for tests of Google Test's XML output functionality.

Member Function Documentation

def gtest_xml_test_utils.GTestXMLTestCase.AssertEquivalentNodes (   self,
  expected_node,
  actual_node 
)
Asserts that actual_node (a DOM node object) is equivalent to
expected_node (another DOM node object), in that either both of
them are CDATA nodes and have the same value, or both are DOM
elements and actual_node meets all of the following conditions:

*  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.
   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
   particular order.

References gtest_xml_test_utils.GTestXMLTestCase._GetChildren(), and gtest_xml_test_utils.GTestXMLTestCase.AssertEquivalentNodes().

Referenced by gtest_xml_test_utils.GTestXMLTestCase.AssertEquivalentNodes(), gtest_xml_outfiles_test.GTestXMLOutFilesTest.testOutfile2(), and gtest_xml_output_unittest.GTestXMLOutputUnitTest.testShardedTestXmlOutput().

def gtest_xml_test_utils.GTestXMLTestCase.NormalizeXml (   self,
  element 
)
Normalizes Google Test's XML output to eliminate references to transient
information that may change from run to run.

*  The "time" attribute of <testsuites>, <testsuite> and <testcase>
   elements is replaced with a single asterisk, if it contains
   only digit characters.
*  The "timestamp" attribute of <testsuites> elements is replaced with a
   single asterisk, if it contains a valid ISO8601 datetime value.
*  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 info reported in the first line of the "message"
   attribute and CDATA section of <failure> elements is replaced with the
   file's basename and a single asterisk for the line number.
*  The directory names in file paths are removed.
*  The stack traces are removed.

References gtest_xml_test_utils.GTestXMLTestCase.NormalizeXml().

Referenced by gtest_xml_test_utils.GTestXMLTestCase.NormalizeXml(), gtest_xml_outfiles_test.GTestXMLOutFilesTest.testOutfile2(), and gtest_xml_output_unittest.GTestXMLOutputUnitTest.testShardedTestXmlOutput().

Member Data Documentation

dictionary gtest_xml_test_utils.GTestXMLTestCase.identifying_attribute
static
Initial value:
1 = {
2  'testsuites': 'name',
3  'testsuite': 'name',
4  'testcase': 'name',
5  'failure': 'message',
6  'property': 'name',
7  }

The documentation for this class was generated from the following file: