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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 193 |
194 def GetTestsFromDevice(runner): | 194 def GetTestsFromDevice(runner): |
195 """Get a list of tests from a device, excluding disabled tests. | 195 """Get a list of tests from a device, excluding disabled tests. |
196 | 196 |
197 Args: | 197 Args: |
198 runner: a TestRunner. | 198 runner: a TestRunner. |
199 Returns: | 199 Returns: |
200 All non-disabled tests on the device. | 200 All non-disabled tests on the device. |
201 """ | 201 """ |
202 # The executable/apk needs to be copied before we can call GetAllTests. | 202 # The executable/apk needs to be copied before we can call GetAllTests. |
203 runner.test_package.StripAndCopyExecutable() | 203 runner.test_package.Install() |
204 all_tests = runner.test_package.GetAllTests() | 204 all_tests = runner.test_package.GetAllTests() |
205 # Only includes tests that do not have any match in the disabled list. | 205 # Only includes tests that do not have any match in the disabled list. |
206 disabled_list = runner.GetDisabledTests() | 206 disabled_list = runner.GetDisabledTests() |
207 return filter(lambda t: not any([fnmatch.fnmatch(t, disabled_pattern) | 207 return filter(lambda t: not any([fnmatch.fnmatch(t, disabled_pattern) |
208 for disabled_pattern in disabled_list]), | 208 for disabled_pattern in disabled_list]), |
209 all_tests) | 209 all_tests) |
210 | 210 |
211 | 211 |
212 def GetAllEnabledTests(runner_factory, devices): | 212 def GetAllEnabledTests(runner_factory, devices): |
213 """Get all enabled tests. | 213 """Get all enabled tests. |
(...skipping 147 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 |