Adding Peter Thatcher to the owners file.
[chromium-blink-merge.git] / build / android / pylib / gtest / gtest_test_instance_test.py
blobc52b2354c4183663890327e471e6306c1db2997f
1 #!/usr/bin/env python
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.
6 import unittest
8 from pylib.gtest import gtest_test_instance
11 class GtestTestInstanceTests(unittest.TestCase):
13 def testParseGTestListTests_simple(self):
14 raw_output = [
15 'TestCaseOne.',
16 ' testOne',
17 ' testTwo',
18 'TestCaseTwo.',
19 ' testThree',
20 ' testFour',
22 actual = gtest_test_instance.ParseGTestListTests(raw_output)
23 expected = [
24 'TestCaseOne.testOne',
25 'TestCaseOne.testTwo',
26 'TestCaseTwo.testThree',
27 'TestCaseTwo.testFour',
29 self.assertEqual(expected, actual)
31 def testParseGTestListTests_typeParameterized_old(self):
32 raw_output = [
33 'TPTestCase/WithTypeParam/0.',
34 ' testOne',
35 ' testTwo',
37 actual = gtest_test_instance.ParseGTestListTests(raw_output)
38 expected = [
39 'TPTestCase/WithTypeParam/0.testOne',
40 'TPTestCase/WithTypeParam/0.testTwo',
42 self.assertEqual(expected, actual)
44 def testParseGTestListTests_typeParameterized_new(self):
45 raw_output = [
46 'TPTestCase/WithTypeParam/0. # TypeParam = TypeParam0',
47 ' testOne',
48 ' testTwo',
50 actual = gtest_test_instance.ParseGTestListTests(raw_output)
51 expected = [
52 'TPTestCase/WithTypeParam/0.testOne',
53 'TPTestCase/WithTypeParam/0.testTwo',
55 self.assertEqual(expected, actual)
57 def testParseGTestListTests_valueParameterized_old(self):
58 raw_output = [
59 'VPTestCase.',
60 ' testWithValueParam/0',
61 ' testWithValueParam/1',
63 actual = gtest_test_instance.ParseGTestListTests(raw_output)
64 expected = [
65 'VPTestCase.testWithValueParam/0',
66 'VPTestCase.testWithValueParam/1',
68 self.assertEqual(expected, actual)
70 def testParseGTestListTests_valueParameterized_new(self):
71 raw_output = [
72 'VPTestCase.',
73 ' testWithValueParam/0 # GetParam() = 0',
74 ' testWithValueParam/1 # GetParam() = 1',
76 actual = gtest_test_instance.ParseGTestListTests(raw_output)
77 expected = [
78 'VPTestCase.testWithValueParam/0',
79 'VPTestCase.testWithValueParam/1',
81 self.assertEqual(expected, actual)
84 if __name__ == '__main__':
85 unittest.main(verbosity=2)