OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 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 """Dispatches GTests.""" | 5 """Dispatches GTests.""" |
6 | 6 |
7 import copy | 7 import copy |
8 import fnmatch | 8 import fnmatch |
9 import glob | 9 import glob |
10 import logging | 10 import logging |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 195 |
196 def GetTestsFromDevice(runner): | 196 def GetTestsFromDevice(runner): |
197 """Get a list of tests from a device, excluding disabled tests. | 197 """Get a list of tests from a device, excluding disabled tests. |
198 | 198 |
199 Args: | 199 Args: |
200 runner: a TestRunner. | 200 runner: a TestRunner. |
201 Returns: | 201 Returns: |
202 All non-disabled tests on the device. | 202 All non-disabled tests on the device. |
203 """ | 203 """ |
204 # The executable/apk needs to be copied before we can call GetAllTests. | 204 # The executable/apk needs to be copied before we can call GetAllTests. |
205 runner.test_package.StripAndCopyExecutable() | 205 runner.test_package.Install() |
206 all_tests = runner.test_package.GetAllTests() | 206 all_tests = runner.test_package.GetAllTests() |
207 # Only includes tests that do not have any match in the disabled list. | 207 # Only includes tests that do not have any match in the disabled list. |
208 disabled_list = runner.GetDisabledTests() | 208 disabled_list = runner.GetDisabledTests() |
209 return filter(lambda t: not any([fnmatch.fnmatch(t, disabled_pattern) | 209 return filter(lambda t: not any([fnmatch.fnmatch(t, disabled_pattern) |
210 for disabled_pattern in disabled_list]), | 210 for disabled_pattern in disabled_list]), |
211 all_tests) | 211 all_tests) |
212 | 212 |
213 | 213 |
214 def GetAllEnabledTests(runner_factory, devices): | 214 def GetAllEnabledTests(runner_factory, devices): |
215 """Get all enabled tests. | 215 """Get all enabled tests. |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 test_options.test_suite = suite_path | 361 test_options.test_suite = suite_path |
362 test_results, test_exit_code = _RunATestSuite(test_options, suite_name) | 362 test_results, test_exit_code = _RunATestSuite(test_options, suite_name) |
363 results.AddTestRunResults(test_results) | 363 results.AddTestRunResults(test_results) |
364 if test_exit_code and exit_code != constants.ERROR_EXIT_CODE: | 364 if test_exit_code and exit_code != constants.ERROR_EXIT_CODE: |
365 exit_code = test_exit_code | 365 exit_code = test_exit_code |
366 | 366 |
367 if options.use_xvfb: | 367 if options.use_xvfb: |
368 framebuffer.Stop() | 368 framebuffer.Stop() |
369 | 369 |
370 return (results, exit_code) | 370 return (results, exit_code) |
OLD | NEW |