| 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.base import base_test_result | 8 from pylib.base import base_test_result |
| 9 from pylib.gtest import gtest_test_instance | 9 from pylib.gtest import gtest_test_instance |
| 10 | 10 |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 'positive1', | 203 'positive1', |
| 204 'positive2', | 204 'positive2', |
| 205 '-negative1', | 205 '-negative1', |
| 206 '-negative2' | 206 '-negative2' |
| 207 ] | 207 ] |
| 208 actual = gtest_test_instance \ | 208 actual = gtest_test_instance \ |
| 209 .ConvertTestFilterFileIntoGTestFilterArgument(input_lines) | 209 .ConvertTestFilterFileIntoGTestFilterArgument(input_lines) |
| 210 expected = 'positive1:positive2-negative1:negative2' | 210 expected = 'positive1:positive2-negative1:negative2' |
| 211 self.assertEquals(expected, actual) | 211 self.assertEquals(expected, actual) |
| 212 | 212 |
| 213 def testTestNameWithoutDisabledPrefix_disabled(self): |
| 214 test_name_list = [ |
| 215 'A.DISABLED_B', |
| 216 'DISABLED_A.B', |
| 217 'DISABLED_A.DISABLED_B', |
| 218 ] |
| 219 for test_name in test_name_list: |
| 220 actual = gtest_test_instance \ |
| 221 .TestNameWithoutDisabledPrefix(test_name) |
| 222 expected = 'A.B' |
| 223 self.assertEquals(expected, actual) |
| 224 |
| 225 def testTestNameWithoutDisabledPrefix_flaky(self): |
| 226 test_name_list = [ |
| 227 'A.FLAKY_B', |
| 228 'FLAKY_A.B', |
| 229 'FLAKY_A.FLAKY_B', |
| 230 ] |
| 231 for test_name in test_name_list: |
| 232 actual = gtest_test_instance \ |
| 233 .TestNameWithoutDisabledPrefix(test_name) |
| 234 expected = 'A.B' |
| 235 self.assertEquals(expected, actual) |
| 236 |
| 237 def testTestNameWithoutDisabledPrefix_notDisabledOrFlaky(self): |
| 238 test_name = 'A.B' |
| 239 actual = gtest_test_instance \ |
| 240 .TestNameWithoutDisabledPrefix(test_name) |
| 241 expected = 'A.B' |
| 242 self.assertEquals(expected, actual) |
| 243 |
| 213 | 244 |
| 214 if __name__ == '__main__': | 245 if __name__ == '__main__': |
| 215 unittest.main(verbosity=2) | 246 unittest.main(verbosity=2) |
| 216 | 247 |
| OLD | NEW |