OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 """Runs the Python tests (relies on using the Java test runner).""" | 5 """Runs the Python tests (relies on using the Java test runner).""" |
6 | 6 |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import sys | 9 import sys |
10 import types | 10 import types |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 test_names = [t.qualified_name for t in available_tests] | 82 test_names = [t.qualified_name for t in available_tests] |
83 logging.debug('Final list of tests to run: ' + str(test_names)) | 83 logging.debug('Final list of tests to run: ' + str(test_names)) |
84 | 84 |
85 # Copy files to each device before running any tests. | 85 # Copy files to each device before running any tests. |
86 for device_id in attached_devices: | 86 for device_id in attached_devices: |
87 logging.debug('Pushing files to device %s', device_id) | 87 logging.debug('Pushing files to device %s', device_id) |
88 test_pkg = test_package.TestPackage(options.test_apk_path, | 88 test_pkg = test_package.TestPackage(options.test_apk_path, |
89 options.test_apk_jar_path) | 89 options.test_apk_jar_path) |
90 test_files_copier = test_runner.TestRunner( | 90 test_files_copier = test_runner.TestRunner( |
91 options, device_id, 0, test_pkg, []) | 91 options.build_type, options.test_data, options.install_apk, |
| 92 options.save_perf_json, options.screenshot_failures, options.tool, |
| 93 options.wait_for_debugger, options.disable_assertions, |
| 94 options.push_deps, options.cleanup_test_files, device_id, 0, test_pkg, |
| 95 []) |
92 test_files_copier.InstallTestPackage() | 96 test_files_copier.InstallTestPackage() |
93 if options.push_deps: | 97 if options.push_deps: |
94 logging.info('Pushing data deps to device.') | 98 logging.info('Pushing data deps to device.') |
95 test_files_copier.PushDataDeps() | 99 test_files_copier.PushDataDeps() |
96 else: | 100 else: |
97 logging.warning('Skipping pushing data deps to device.') | 101 logging.warning('Skipping pushing data deps to device.') |
98 | 102 |
99 # Actually run the tests. | 103 # Actually run the tests. |
100 if len(attached_devices) > 1 and options.wait_for_debugger: | 104 if len(attached_devices) > 1 and options.wait_for_debugger: |
101 logging.warning('Debugger can not be sharded, ' | 105 logging.warning('Debugger can not be sharded, ' |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 Returns: | 212 Returns: |
209 List of test case objects for all available test methods. | 213 List of test case objects for all available test methods. |
210 """ | 214 """ |
211 if not test_root: | 215 if not test_root: |
212 return [] | 216 return [] |
213 all_tests = [] | 217 all_tests = [] |
214 test_module_list = _GetTestModules(test_root, is_official_build) | 218 test_module_list = _GetTestModules(test_root, is_official_build) |
215 for module in test_module_list: | 219 for module in test_module_list: |
216 all_tests.extend(_GetTestClassesFromModule(module)) | 220 all_tests.extend(_GetTestClassesFromModule(module)) |
217 return all_tests | 221 return all_tests |
OLD | NEW |