[Android] Fix type-parameterized gtest parsing.

BUG=

Review URL: https://codereview.chromium.org/441023002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287701 0039d316-1c4b-4281-b951-d872f2087c98
parent 3ea5a0d7
......@@ -88,14 +88,11 @@ class TestPackage(object):
for test in raw_list:
if not test:
continue
if test[0] != ' ' and not test.endswith('.'):
# Ignore any lines with unexpected format.
continue
if test[0] != ' ' and test.endswith('.'):
current = test
continue
if 'YOU HAVE' in test:
break
test_name = test.split(None, 1)[0]
ret += [current + test_name]
if test[0] != ' ':
test_case = test.split()[0]
if test_case.endswith('.'):
current = test_case
elif not 'YOU HAVE' in test:
test_name = test.split()[0]
ret += [current + test_name]
return ret
......@@ -30,29 +30,55 @@ class TestPackageTest(unittest.TestCase):
]
self.assertEqual(expected, actual)
def testParseGTestListTests_parameterized_old(self):
def testParseGTestListTests_typeParameterized_old(self):
raw_output = [
'PTestCase.',
'TPTestCase/WithTypeParam/0.',
' testOne',
' testTwo',
]
actual = test_package.TestPackage._ParseGTestListTests(raw_output)
expected = [
'TPTestCase/WithTypeParam/0.testOne',
'TPTestCase/WithTypeParam/0.testTwo',
]
self.assertEqual(expected, actual)
def testParseGTestListTests_typeParameterized_new(self):
raw_output = [
'TPTestCase/WithTypeParam/0. # TypeParam = TypeParam0',
' testOne',
' testTwo',
]
actual = test_package.TestPackage._ParseGTestListTests(raw_output)
expected = [
'TPTestCase/WithTypeParam/0.testOne',
'TPTestCase/WithTypeParam/0.testTwo',
]
self.assertEqual(expected, actual)
def testParseGTestListTests_valueParameterized_old(self):
raw_output = [
'VPTestCase.',
' testWithValueParam/0',
' testWithValueParam/1',
]
actual = test_package.TestPackage._ParseGTestListTests(raw_output)
expected = [
'PTestCase.testWithValueParam/0',
'PTestCase.testWithValueParam/1',
'VPTestCase.testWithValueParam/0',
'VPTestCase.testWithValueParam/1',
]
self.assertEqual(expected, actual)
def testParseGTestListTests_parameterized_new(self):
def testParseGTestListTests_valueParameterized_new(self):
raw_output = [
'PTestCase.',
'VPTestCase.',
' testWithValueParam/0 # GetParam() = 0',
' testWithValueParam/1 # GetParam() = 1',
]
actual = test_package.TestPackage._ParseGTestListTests(raw_output)
expected = [
'PTestCase.testWithValueParam/0',
'PTestCase.testWithValueParam/1',
'VPTestCase.testWithValueParam/0',
'VPTestCase.testWithValueParam/1',
]
self.assertEqual(expected, actual)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment