OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Generates test runner factory and tests for GTests.""" | 5 """Generates test runner factory and tests for GTests.""" |
6 # pylint: disable=W0212 | 6 # pylint: disable=W0212 |
7 | 7 |
8 import fnmatch | 8 import fnmatch |
9 import glob | 9 import glob |
10 import logging | 10 import logging |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 Args: | 206 Args: |
207 test_options: A GTestOptions object. | 207 test_options: A GTestOptions object. |
208 test_package: A TestPackageApk object. | 208 test_package: A TestPackageApk object. |
209 devices: A list of attached devices. | 209 devices: A list of attached devices. |
210 | 210 |
211 Returns: | 211 Returns: |
212 A list of all the tests in the test suite. | 212 A list of all the tests in the test suite. |
213 """ | 213 """ |
214 def TestListerRunnerFactory(device, _shard_index): | 214 def TestListerRunnerFactory(device, _shard_index): |
215 class TestListerRunner(test_runner.TestRunner): | 215 class TestListerRunner(test_runner.TestRunner): |
216 #override | |
217 def PushDataDeps(self): | |
218 pass | |
219 | |
220 #override | |
221 def RunTest(self, _test): | 216 def RunTest(self, _test): |
222 result = base_test_result.BaseTestResult( | 217 result = base_test_result.BaseTestResult( |
223 'gtest_list_tests', base_test_result.ResultType.PASS) | 218 'gtest_list_tests', base_test_result.ResultType.PASS) |
224 self.test_package.Install(self.device) | 219 self.test_package.Install(self.device) |
225 result.test_list = self.test_package.GetAllTests(self.device) | 220 result.test_list = self.test_package.GetAllTests(self.device) |
226 results = base_test_result.TestRunResults() | 221 results = base_test_result.TestRunResults() |
227 results.AddResult(result) | 222 results.AddResult(result) |
228 return results, None | 223 return results, None |
229 return TestListerRunner(test_options, device, test_package) | 224 return TestListerRunner(test_options, device, test_package) |
230 | 225 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 if test_options.gtest_filter: | 324 if test_options.gtest_filter: |
330 tests = unittest_util.FilterTestNames(tests, test_options.gtest_filter) | 325 tests = unittest_util.FilterTestNames(tests, test_options.gtest_filter) |
331 | 326 |
332 # Coalesce unit tests into a single test per device | 327 # Coalesce unit tests into a single test per device |
333 if test_options.suite_name != 'content_browsertests': | 328 if test_options.suite_name != 'content_browsertests': |
334 num_devices = len(devices) | 329 num_devices = len(devices) |
335 tests = [':'.join(tests[i::num_devices]) for i in xrange(num_devices)] | 330 tests = [':'.join(tests[i::num_devices]) for i in xrange(num_devices)] |
336 tests = [t for t in tests if t] | 331 tests = [t for t in tests if t] |
337 | 332 |
338 return (TestRunnerFactory, tests) | 333 return (TestRunnerFactory, tests) |
OLD | NEW |