OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import unittest | 6 import unittest |
7 | 7 |
8 from pylib.gtest import test_package | 8 from pylib.gtest import test_package |
9 | 9 |
10 # pylint: disable=W0212 | 10 # pylint: disable=W0212 |
(...skipping 12 matching lines...) Expand all Loading... |
23 ] | 23 ] |
24 actual = test_package.TestPackage._ParseGTestListTests(raw_output) | 24 actual = test_package.TestPackage._ParseGTestListTests(raw_output) |
25 expected = [ | 25 expected = [ |
26 'TestCaseOne.testOne', | 26 'TestCaseOne.testOne', |
27 'TestCaseOne.testTwo', | 27 'TestCaseOne.testTwo', |
28 'TestCaseTwo.testThree', | 28 'TestCaseTwo.testThree', |
29 'TestCaseTwo.testFour', | 29 'TestCaseTwo.testFour', |
30 ] | 30 ] |
31 self.assertEqual(expected, actual) | 31 self.assertEqual(expected, actual) |
32 | 32 |
33 def testParseGTestListTests_parameterized_old(self): | 33 def testParseGTestListTests_typeParameterized_old(self): |
34 raw_output = [ | 34 raw_output = [ |
35 'PTestCase.', | 35 'TPTestCase/WithTypeParam/0.', |
| 36 ' testOne', |
| 37 ' testTwo', |
| 38 ] |
| 39 actual = test_package.TestPackage._ParseGTestListTests(raw_output) |
| 40 expected = [ |
| 41 'TPTestCase/WithTypeParam/0.testOne', |
| 42 'TPTestCase/WithTypeParam/0.testTwo', |
| 43 ] |
| 44 self.assertEqual(expected, actual) |
| 45 |
| 46 def testParseGTestListTests_typeParameterized_new(self): |
| 47 raw_output = [ |
| 48 'TPTestCase/WithTypeParam/0. # TypeParam = TypeParam0', |
| 49 ' testOne', |
| 50 ' testTwo', |
| 51 ] |
| 52 actual = test_package.TestPackage._ParseGTestListTests(raw_output) |
| 53 expected = [ |
| 54 'TPTestCase/WithTypeParam/0.testOne', |
| 55 'TPTestCase/WithTypeParam/0.testTwo', |
| 56 ] |
| 57 self.assertEqual(expected, actual) |
| 58 |
| 59 def testParseGTestListTests_valueParameterized_old(self): |
| 60 raw_output = [ |
| 61 'VPTestCase.', |
36 ' testWithValueParam/0', | 62 ' testWithValueParam/0', |
37 ' testWithValueParam/1', | 63 ' testWithValueParam/1', |
38 ] | 64 ] |
39 actual = test_package.TestPackage._ParseGTestListTests(raw_output) | 65 actual = test_package.TestPackage._ParseGTestListTests(raw_output) |
40 expected = [ | 66 expected = [ |
41 'PTestCase.testWithValueParam/0', | 67 'VPTestCase.testWithValueParam/0', |
42 'PTestCase.testWithValueParam/1', | 68 'VPTestCase.testWithValueParam/1', |
43 ] | 69 ] |
44 self.assertEqual(expected, actual) | 70 self.assertEqual(expected, actual) |
45 | 71 |
46 def testParseGTestListTests_parameterized_new(self): | 72 def testParseGTestListTests_valueParameterized_new(self): |
47 raw_output = [ | 73 raw_output = [ |
48 'PTestCase.', | 74 'VPTestCase.', |
49 ' testWithValueParam/0 # GetParam() = 0', | 75 ' testWithValueParam/0 # GetParam() = 0', |
50 ' testWithValueParam/1 # GetParam() = 1', | 76 ' testWithValueParam/1 # GetParam() = 1', |
51 ] | 77 ] |
52 actual = test_package.TestPackage._ParseGTestListTests(raw_output) | 78 actual = test_package.TestPackage._ParseGTestListTests(raw_output) |
53 expected = [ | 79 expected = [ |
54 'PTestCase.testWithValueParam/0', | 80 'VPTestCase.testWithValueParam/0', |
55 'PTestCase.testWithValueParam/1', | 81 'VPTestCase.testWithValueParam/1', |
56 ] | 82 ] |
57 self.assertEqual(expected, actual) | 83 self.assertEqual(expected, actual) |
58 | 84 |
59 | 85 |
60 if __name__ == '__main__': | 86 if __name__ == '__main__': |
61 unittest.main(verbosity=2) | 87 unittest.main(verbosity=2) |
62 | 88 |
OLD | NEW |