| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright 2013 The Chromium Authors. All rights reserved. | 3 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """Runs all types of tests from one unified interface.""" | 7 """Runs all types of tests from one unified interface.""" |
| 8 | 8 |
| 9 import collections | 9 import collections |
| 10 import logging | 10 import logging |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 from pylib.host_driven import setup as host_driven_setup | 28 from pylib.host_driven import setup as host_driven_setup |
| 29 from pylib.instrumentation import setup as instrumentation_setup | 29 from pylib.instrumentation import setup as instrumentation_setup |
| 30 from pylib.instrumentation import test_options as instrumentation_test_options | 30 from pylib.instrumentation import test_options as instrumentation_test_options |
| 31 from pylib.monkey import setup as monkey_setup | 31 from pylib.monkey import setup as monkey_setup |
| 32 from pylib.monkey import test_options as monkey_test_options | 32 from pylib.monkey import test_options as monkey_test_options |
| 33 from pylib.perf import setup as perf_setup | 33 from pylib.perf import setup as perf_setup |
| 34 from pylib.perf import test_options as perf_test_options | 34 from pylib.perf import test_options as perf_test_options |
| 35 from pylib.perf import test_runner as perf_test_runner | 35 from pylib.perf import test_runner as perf_test_runner |
| 36 from pylib.uiautomator import setup as uiautomator_setup | 36 from pylib.uiautomator import setup as uiautomator_setup |
| 37 from pylib.uiautomator import test_options as uiautomator_test_options | 37 from pylib.uiautomator import test_options as uiautomator_test_options |
| 38 from pylib.utils import apk_helper |
| 38 from pylib.utils import command_option_parser | 39 from pylib.utils import command_option_parser |
| 39 from pylib.utils import report_results | 40 from pylib.utils import report_results |
| 40 from pylib.utils import reraiser_thread | 41 from pylib.utils import reraiser_thread |
| 41 from pylib.utils import run_tests_helper | 42 from pylib.utils import run_tests_helper |
| 42 | 43 |
| 43 | 44 |
| 44 def AddCommonOptions(option_parser): | 45 def AddCommonOptions(option_parser): |
| 45 """Adds all common options to |option_parser|.""" | 46 """Adds all common options to |option_parser|.""" |
| 46 | 47 |
| 47 group = optparse.OptionGroup(option_parser, 'Common Options') | 48 group = optparse.OptionGroup(option_parser, 'Common Options') |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 elif options.python_only: | 263 elif options.python_only: |
| 263 options.run_java_tests = False | 264 options.run_java_tests = False |
| 264 | 265 |
| 265 if not options.host_driven_root: | 266 if not options.host_driven_root: |
| 266 options.run_python_tests = False | 267 options.run_python_tests = False |
| 267 | 268 |
| 268 if not options.test_apk: | 269 if not options.test_apk: |
| 269 error_func('--test-apk must be specified.') | 270 error_func('--test-apk must be specified.') |
| 270 | 271 |
| 271 | 272 |
| 272 options.test_apk_path = os.path.join(constants.GetOutDirectory(), | 273 options.test_apk_path = os.path.join( |
| 273 constants.SDK_BUILD_APKS_DIR, | 274 constants.GetOutDirectory(), |
| 274 '%s.apk' % options.test_apk) | 275 constants.SDK_BUILD_APKS_DIR, |
| 276 '%s.apk' % options.test_apk) |
| 275 options.test_apk_jar_path = os.path.join( | 277 options.test_apk_jar_path = os.path.join( |
| 276 constants.GetOutDirectory(), | 278 constants.GetOutDirectory(), |
| 277 constants.SDK_BUILD_TEST_JAVALIB_DIR, | 279 constants.SDK_BUILD_TEST_JAVALIB_DIR, |
| 278 '%s.jar' % options.test_apk) | 280 '%s.jar' % options.test_apk) |
| 281 options.test_support_apk_path = '%sSupport%s' % ( |
| 282 os.path.splitext(options.test_apk_path)) |
| 279 | 283 |
| 280 options.test_support_apk_path = '%sSupport%s' % ( | 284 options.test_runner = apk_helper.GetInstrumentationName(options.test_apk_path) |
| 281 os.path.splitext(options.test_apk_path)) | |
| 282 | |
| 283 | 285 |
| 284 return instrumentation_test_options.InstrumentationOptions( | 286 return instrumentation_test_options.InstrumentationOptions( |
| 285 options.tool, | 287 options.tool, |
| 286 options.cleanup_test_files, | 288 options.cleanup_test_files, |
| 287 options.push_deps, | 289 options.push_deps, |
| 288 options.annotations, | 290 options.annotations, |
| 289 options.exclude_annotations, | 291 options.exclude_annotations, |
| 290 options.test_filter, | 292 options.test_filter, |
| 291 options.test_data, | 293 options.test_data, |
| 294 options.test_runner, |
| 292 options.save_perf_json, | 295 options.save_perf_json, |
| 293 options.screenshot_failures, | 296 options.screenshot_failures, |
| 294 options.wait_for_debugger, | 297 options.wait_for_debugger, |
| 295 options.coverage_dir, | 298 options.coverage_dir, |
| 296 options.test_apk, | 299 options.test_apk, |
| 297 options.test_apk_path, | 300 options.test_apk_path, |
| 298 options.test_apk_jar_path, | 301 options.test_apk_jar_path, |
| 299 options.test_support_apk_path | 302 options.test_support_apk_path |
| 300 ) | 303 ) |
| 301 | 304 |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 824 | 827 |
| 825 def main(): | 828 def main(): |
| 826 signal.signal(signal.SIGUSR1, DumpThreadStacks) | 829 signal.signal(signal.SIGUSR1, DumpThreadStacks) |
| 827 option_parser = command_option_parser.CommandOptionParser( | 830 option_parser = command_option_parser.CommandOptionParser( |
| 828 commands_dict=VALID_COMMANDS) | 831 commands_dict=VALID_COMMANDS) |
| 829 return command_option_parser.ParseAndExecute(option_parser) | 832 return command_option_parser.ParseAndExecute(option_parser) |
| 830 | 833 |
| 831 | 834 |
| 832 if __name__ == '__main__': | 835 if __name__ == '__main__': |
| 833 sys.exit(main()) | 836 sys.exit(main()) |
| OLD | NEW |