| 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 logging | 11 import logging |
| 12 import os | 12 import os |
| 13 import shutil | 13 import shutil |
| 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 from devil import base_error |
| 20 from devil.android import apk_helper |
| 21 from devil.android import device_blacklist |
| 22 from devil.android import device_errors |
| 23 from devil.android import device_utils |
| 24 from devil.android import ports |
| 25 from devil.utils import reraiser_thread |
| 26 from devil.utils import run_tests_helper |
| 27 |
| 19 from pylib import constants | 28 from pylib import constants |
| 20 from pylib import forwarder | 29 from pylib import forwarder |
| 21 from pylib import ports | |
| 22 from pylib.base import base_test_result | 30 from pylib.base import base_test_result |
| 23 from pylib.base import environment_factory | 31 from pylib.base import environment_factory |
| 24 from pylib.base import test_dispatcher | 32 from pylib.base import test_dispatcher |
| 25 from pylib.base import test_instance_factory | 33 from pylib.base import test_instance_factory |
| 26 from pylib.base import test_run_factory | 34 from pylib.base import test_run_factory |
| 27 from pylib.device import device_blacklist | |
| 28 from pylib.device import device_errors | |
| 29 from pylib.device import device_utils | |
| 30 from pylib.gtest import gtest_config | 35 from pylib.gtest import gtest_config |
| 31 # TODO(jbudorick): Remove this once we stop selectively enabling platform mode. | 36 # TODO(jbudorick): Remove this once we stop selectively enabling platform mode. |
| 32 from pylib.gtest import gtest_test_instance | 37 from pylib.gtest import gtest_test_instance |
| 33 from pylib.gtest import setup as gtest_setup | 38 from pylib.gtest import setup as gtest_setup |
| 34 from pylib.gtest import test_options as gtest_test_options | 39 from pylib.gtest import test_options as gtest_test_options |
| 35 from pylib.linker import setup as linker_setup | 40 from pylib.linker import setup as linker_setup |
| 36 from pylib.host_driven import setup as host_driven_setup | 41 from pylib.host_driven import setup as host_driven_setup |
| 37 from pylib.instrumentation import setup as instrumentation_setup | 42 from pylib.instrumentation import setup as instrumentation_setup |
| 38 from pylib.instrumentation import test_options as instrumentation_test_options | 43 from pylib.instrumentation import test_options as instrumentation_test_options |
| 39 from pylib.junit import setup as junit_setup | 44 from pylib.junit import setup as junit_setup |
| 40 from pylib.junit import test_dispatcher as junit_dispatcher | 45 from pylib.junit import test_dispatcher as junit_dispatcher |
| 41 from pylib.monkey import setup as monkey_setup | 46 from pylib.monkey import setup as monkey_setup |
| 42 from pylib.monkey import test_options as monkey_test_options | 47 from pylib.monkey import test_options as monkey_test_options |
| 43 from pylib.perf import setup as perf_setup | 48 from pylib.perf import setup as perf_setup |
| 44 from pylib.perf import test_options as perf_test_options | 49 from pylib.perf import test_options as perf_test_options |
| 45 from pylib.perf import test_runner as perf_test_runner | 50 from pylib.perf import test_runner as perf_test_runner |
| 46 from pylib.results import json_results | 51 from pylib.results import json_results |
| 47 from pylib.results import report_results | 52 from pylib.results import report_results |
| 48 from pylib.uiautomator import setup as uiautomator_setup | 53 from pylib.uiautomator import setup as uiautomator_setup |
| 49 from pylib.uiautomator import test_options as uiautomator_test_options | 54 from pylib.uiautomator import test_options as uiautomator_test_options |
| 50 from pylib.utils import apk_helper | |
| 51 from pylib.utils import base_error | |
| 52 from pylib.utils import reraiser_thread | |
| 53 from pylib.utils import run_tests_helper | |
| 54 | 55 |
| 55 | 56 |
| 56 def AddCommonOptions(parser): | 57 def AddCommonOptions(parser): |
| 57 """Adds all common options to |parser|.""" | 58 """Adds all common options to |parser|.""" |
| 58 | 59 |
| 59 group = parser.add_argument_group('Common Options') | 60 group = parser.add_argument_group('Common Options') |
| 60 | 61 |
| 61 default_build_type = os.environ.get('BUILDTYPE', 'Debug') | 62 default_build_type = os.environ.get('BUILDTYPE', 'Debug') |
| 62 | 63 |
| 63 debug_or_release_group = group.add_mutually_exclusive_group() | 64 debug_or_release_group = group.add_mutually_exclusive_group() |
| (...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1065 if e.is_infra_error: | 1066 if e.is_infra_error: |
| 1066 return constants.INFRA_EXIT_CODE | 1067 return constants.INFRA_EXIT_CODE |
| 1067 return constants.ERROR_EXIT_CODE | 1068 return constants.ERROR_EXIT_CODE |
| 1068 except: # pylint: disable=W0702 | 1069 except: # pylint: disable=W0702 |
| 1069 logging.exception('Unrecognized error occurred.') | 1070 logging.exception('Unrecognized error occurred.') |
| 1070 return constants.ERROR_EXIT_CODE | 1071 return constants.ERROR_EXIT_CODE |
| 1071 | 1072 |
| 1072 | 1073 |
| 1073 if __name__ == '__main__': | 1074 if __name__ == '__main__': |
| 1074 sys.exit(main()) | 1075 sys.exit(main()) |
| OLD | NEW |