2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
8 from pylib
.gtest
import gtest_test_instance
11 class GtestTestInstanceTests(unittest
.TestCase
):
13 def testParseGTestListTests_simple(self
):
22 actual
= gtest_test_instance
.ParseGTestListTests(raw_output
)
24 'TestCaseOne.testOne',
25 'TestCaseOne.testTwo',
26 'TestCaseTwo.testThree',
27 'TestCaseTwo.testFour',
29 self
.assertEqual(expected
, actual
)
31 def testParseGTestListTests_typeParameterized_old(self
):
33 'TPTestCase/WithTypeParam/0.',
37 actual
= gtest_test_instance
.ParseGTestListTests(raw_output
)
39 'TPTestCase/WithTypeParam/0.testOne',
40 'TPTestCase/WithTypeParam/0.testTwo',
42 self
.assertEqual(expected
, actual
)
44 def testParseGTestListTests_typeParameterized_new(self
):
46 'TPTestCase/WithTypeParam/0. # TypeParam = TypeParam0',
50 actual
= gtest_test_instance
.ParseGTestListTests(raw_output
)
52 'TPTestCase/WithTypeParam/0.testOne',
53 'TPTestCase/WithTypeParam/0.testTwo',
55 self
.assertEqual(expected
, actual
)
57 def testParseGTestListTests_valueParameterized_old(self
):
60 ' testWithValueParam/0',
61 ' testWithValueParam/1',
63 actual
= gtest_test_instance
.ParseGTestListTests(raw_output
)
65 'VPTestCase.testWithValueParam/0',
66 'VPTestCase.testWithValueParam/1',
68 self
.assertEqual(expected
, actual
)
70 def testParseGTestListTests_valueParameterized_new(self
):
73 ' testWithValueParam/0 # GetParam() = 0',
74 ' testWithValueParam/1 # GetParam() = 1',
76 actual
= gtest_test_instance
.ParseGTestListTests(raw_output
)
78 'VPTestCase.testWithValueParam/0',
79 'VPTestCase.testWithValueParam/1',
81 self
.assertEqual(expected
, actual
)
84 if __name__
== '__main__':
85 unittest
.main(verbosity
=2)