| 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 instrumentation tests.""" | 5 """Generates test runner factory and tests for instrumentation tests.""" |
| 6 | 6 |
| 7 import logging | 7 import logging |
| 8 import os | 8 import os |
| 9 | 9 |
| 10 from devil.android import device_utils | 10 from devil.android import device_utils |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 """ | 73 """ |
| 74 if (test_options.coverage_dir and not | 74 if (test_options.coverage_dir and not |
| 75 os.path.exists(test_options.coverage_dir)): | 75 os.path.exists(test_options.coverage_dir)): |
| 76 os.makedirs(test_options.coverage_dir) | 76 os.makedirs(test_options.coverage_dir) |
| 77 | 77 |
| 78 test_pkg = test_package.TestPackage( | 78 test_pkg = test_package.TestPackage( |
| 79 test_options.test_apk_path, | 79 test_options.test_apk_path, |
| 80 test_options.test_apk_jar_path, | 80 test_options.test_apk_jar_path, |
| 81 test_options.test_support_apk_path, | 81 test_options.test_support_apk_path, |
| 82 additional_apks=test_options.additional_apks, | 82 additional_apks=test_options.additional_apks, |
| 83 apk_under_test=test_options.apk_under_test) | 83 apk_under_test=test_options.apk_under_test, |
| 84 test_apk_incremental_install_script= |
| 85 test_options.test_apk_incremental_install_script, |
| 86 apk_under_test_incremental_install_script= |
| 87 test_options.apk_under_test_incremental_install_script) |
| 84 tests = test_pkg.GetAllMatchingTests( | 88 tests = test_pkg.GetAllMatchingTests( |
| 85 test_options.annotations, | 89 test_options.annotations, |
| 86 test_options.exclude_annotations, | 90 test_options.exclude_annotations, |
| 87 test_options.test_filter, | 91 test_options.test_filter, |
| 88 devices) | 92 devices) |
| 89 if not tests: | 93 if not tests: |
| 90 logging.error('No instrumentation tests to run with current args.') | 94 logging.error('No instrumentation tests to run with current args.') |
| 91 | 95 |
| 92 if test_options.test_data: | 96 if test_options.test_data: |
| 93 device_utils.DeviceUtils.parallel(devices).pMap( | 97 device_utils.DeviceUtils.parallel(devices).pMap( |
| (...skipping 12 matching lines...) Expand all Loading... |
| 106 isolator.Clear() | 110 isolator.Clear() |
| 107 | 111 |
| 108 device_utils.DeviceUtils.parallel(devices).pMap( | 112 device_utils.DeviceUtils.parallel(devices).pMap( |
| 109 _PushExtraSuiteDataDeps, test_options.test_apk) | 113 _PushExtraSuiteDataDeps, test_options.test_apk) |
| 110 | 114 |
| 111 def TestRunnerFactory(device, shard_index): | 115 def TestRunnerFactory(device, shard_index): |
| 112 return test_runner.TestRunner(test_options, device, shard_index, | 116 return test_runner.TestRunner(test_options, device, shard_index, |
| 113 test_pkg) | 117 test_pkg) |
| 114 | 118 |
| 115 return (TestRunnerFactory, tests) | 119 return (TestRunnerFactory, tests) |
| OLD | NEW |