Add support for testing of xml and json output of source file and line location
This commit is contained in:
parent
f7621f0191
commit
ee5e3043ce
@ -50,6 +50,8 @@ def normalize(obj):
|
||||
elif key == 'failure':
|
||||
value = re.sub(r'^.*[/\\](.*:)\d+\n', '\\1*\n', value)
|
||||
return re.sub(r'Stack trace:\n(.|\n)*', 'Stack trace:\n*', value)
|
||||
elif key == 'file':
|
||||
return re.sub(r'^.*[/\\](.*)', '\\1', value)
|
||||
else:
|
||||
return normalize(value)
|
||||
if isinstance(obj, dict):
|
||||
|
@ -170,6 +170,10 @@ class GTestXMLTestCase(gtest_test_utils.TestCase):
|
||||
* The stack traces are removed.
|
||||
"""
|
||||
|
||||
if element.tagName == 'testcase':
|
||||
source_file = element.getAttributeNode('file')
|
||||
if source_file:
|
||||
source_file.value = re.sub(r'^.*[/\\](.*)', '\\1', source_file.value)
|
||||
if element.tagName in ('testsuites', 'testsuite', 'testcase'):
|
||||
timestamp = element.getAttributeNode('timestamp')
|
||||
timestamp.value = re.sub(r'^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d\.\d\d\d$',
|
||||
|
Loading…
Reference in New Issue
Block a user