| 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.build_type, options.test_data, options.install_apk, | 91 options.build_type, options.test_data, options.save_perf_json, |
| 92 options.save_perf_json, options.screenshot_failures, options.tool, | 92 options.screenshot_failures, options.tool, options.wait_for_debugger, |
| 93 options.wait_for_debugger, options.disable_assertions, | 93 options.disable_assertions, options.push_deps, |
| 94 options.push_deps, options.cleanup_test_files, device_id, 0, test_pkg, | 94 options.cleanup_test_files, device_id, 0, test_pkg, []) |
| 95 []) | |
| 96 test_files_copier.InstallTestPackage() | 95 test_files_copier.InstallTestPackage() |
| 97 if options.push_deps: | 96 if options.push_deps: |
| 98 logging.info('Pushing data deps to device.') | 97 logging.info('Pushing data deps to device.') |
| 99 test_files_copier.PushDataDeps() | 98 test_files_copier.PushDataDeps() |
| 100 else: | 99 else: |
| 101 logging.warning('Skipping pushing data deps to device.') | 100 logging.warning('Skipping pushing data deps to device.') |
| 102 | 101 |
| 103 # Actually run the tests. | 102 # Actually run the tests. |
| 104 if len(attached_devices) > 1 and options.wait_for_debugger: | 103 if len(attached_devices) > 1 and options.wait_for_debugger: |
| 105 logging.warning('Debugger can not be sharded, ' | 104 logging.warning('Debugger can not be sharded, ' |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 Returns: | 211 Returns: |
| 213 List of test case objects for all available test methods. | 212 List of test case objects for all available test methods. |
| 214 """ | 213 """ |
| 215 if not test_root: | 214 if not test_root: |
| 216 return [] | 215 return [] |
| 217 all_tests = [] | 216 all_tests = [] |
| 218 test_module_list = _GetTestModules(test_root, is_official_build) | 217 test_module_list = _GetTestModules(test_root, is_official_build) |
| 219 for module in test_module_list: | 218 for module in test_module_list: |
| 220 all_tests.extend(_GetTestClassesFromModule(module)) | 219 all_tests.extend(_GetTestClassesFromModule(module)) |
| 221 return all_tests | 220 return all_tests |
| OLD | NEW |