| 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 argparse | 9 import argparse |
| 10 import collections | 10 import collections |
| 11 import itertools | 11 import itertools |
| 12 import logging | 12 import logging |
| 13 import os | 13 import os |
| 14 import signal | 14 import signal |
| 15 import sys | 15 import sys |
| 16 import threading | 16 import threading |
| 17 import unittest | 17 import unittest |
| 18 | 18 |
| 19 import devil_chromium | 19 import devil_chromium |
| 20 | |
| 21 from devil import base_error | 20 from devil import base_error |
| 22 from devil import devil_env | 21 from devil import devil_env |
| 23 from devil.android import apk_helper | 22 from devil.android import apk_helper |
| 24 from devil.android import device_blacklist | 23 from devil.android import device_blacklist |
| 25 from devil.android import device_errors | 24 from devil.android import device_errors |
| 26 from devil.android import device_utils | 25 from devil.android import device_utils |
| 27 from devil.android import forwarder | 26 from devil.android import forwarder |
| 28 from devil.android import ports | 27 from devil.android import ports |
| 29 from devil.utils import reraiser_thread | 28 from devil.utils import reraiser_thread |
| 30 from devil.utils import run_tests_helper | 29 from devil.utils import run_tests_helper |
| 31 | 30 |
| 32 from pylib import constants | 31 from pylib import constants |
| 32 from pylib.constants import host_paths |
| 33 from pylib.base import base_test_result | 33 from pylib.base import base_test_result |
| 34 from pylib.base import environment_factory | 34 from pylib.base import environment_factory |
| 35 from pylib.base import test_dispatcher | 35 from pylib.base import test_dispatcher |
| 36 from pylib.base import test_instance_factory | 36 from pylib.base import test_instance_factory |
| 37 from pylib.base import test_run_factory | 37 from pylib.base import test_run_factory |
| 38 from pylib.linker import setup as linker_setup | 38 from pylib.linker import setup as linker_setup |
| 39 from pylib.host_driven import setup as host_driven_setup | 39 from pylib.host_driven import setup as host_driven_setup |
| 40 from pylib.instrumentation import setup as instrumentation_setup | 40 from pylib.instrumentation import setup as instrumentation_setup |
| 41 from pylib.instrumentation import test_options as instrumentation_test_options | 41 from pylib.instrumentation import test_options as instrumentation_test_options |
| 42 from pylib.junit import setup as junit_setup | 42 from pylib.junit import setup as junit_setup |
| 43 from pylib.junit import test_dispatcher as junit_dispatcher | 43 from pylib.junit import test_dispatcher as junit_dispatcher |
| 44 from pylib.monkey import setup as monkey_setup | 44 from pylib.monkey import setup as monkey_setup |
| 45 from pylib.monkey import test_options as monkey_test_options | 45 from pylib.monkey import test_options as monkey_test_options |
| 46 from pylib.perf import setup as perf_setup | 46 from pylib.perf import setup as perf_setup |
| 47 from pylib.perf import test_options as perf_test_options | 47 from pylib.perf import test_options as perf_test_options |
| 48 from pylib.perf import test_runner as perf_test_runner | 48 from pylib.perf import test_runner as perf_test_runner |
| 49 from pylib.results import json_results | 49 from pylib.results import json_results |
| 50 from pylib.results import report_results | 50 from pylib.results import report_results |
| 51 | 51 |
| 52 | 52 |
| 53 _DEVIL_STATIC_CONFIG_FILE = os.path.abspath(os.path.join( | 53 _DEVIL_STATIC_CONFIG_FILE = os.path.abspath(os.path.join( |
| 54 constants.DIR_SOURCE_ROOT, 'build', 'android', 'devil_config.json')) | 54 host_paths.DIR_SOURCE_ROOT, 'build', 'android', 'devil_config.json')) |
| 55 | 55 |
| 56 | 56 |
| 57 def AddCommonOptions(parser): | 57 def AddCommonOptions(parser): |
| 58 """Adds all common options to |parser|.""" | 58 """Adds all common options to |parser|.""" |
| 59 | 59 |
| 60 group = parser.add_argument_group('Common Options') | 60 group = parser.add_argument_group('Common Options') |
| 61 | 61 |
| 62 default_build_type = os.environ.get('BUILDTYPE', 'Debug') | 62 default_build_type = os.environ.get('BUILDTYPE', 'Debug') |
| 63 | 63 |
| 64 debug_or_release_group = group.add_mutually_exclusive_group() | 64 debug_or_release_group = group.add_mutually_exclusive_group() |
| (...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1086 if e.is_infra_error: | 1086 if e.is_infra_error: |
| 1087 return constants.INFRA_EXIT_CODE | 1087 return constants.INFRA_EXIT_CODE |
| 1088 return constants.ERROR_EXIT_CODE | 1088 return constants.ERROR_EXIT_CODE |
| 1089 except: # pylint: disable=W0702 | 1089 except: # pylint: disable=W0702 |
| 1090 logging.exception('Unrecognized error occurred.') | 1090 logging.exception('Unrecognized error occurred.') |
| 1091 return constants.ERROR_EXIT_CODE | 1091 return constants.ERROR_EXIT_CODE |
| 1092 | 1092 |
| 1093 | 1093 |
| 1094 if __name__ == '__main__': | 1094 if __name__ == '__main__': |
| 1095 sys.exit(main()) | 1095 sys.exit(main()) |
| OLD | NEW |