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 Java tests. See more information on run_instrumentation_tests.py.""" | 5 """Runs the Java tests. See more information on run_instrumentation_tests.py.""" |
6 | 6 |
7 import fnmatch | 7 import fnmatch |
8 import logging | 8 import logging |
9 import os | 9 import os |
10 import re | 10 import re |
11 import shutil | 11 import shutil |
12 import sys | 12 import sys |
13 import time | 13 import time |
14 | 14 |
15 import android_commands | 15 from pylib import android_commands |
| 16 from pylib import cmd_helper |
| 17 from pylib import constants |
| 18 from pylib import sharded_tests_queue |
| 19 from pylib import valgrind_tools |
| 20 from pylib.android_commands import errors |
| 21 from pylib.base_test_runner import BaseTestRunner |
| 22 from pylib.base_test_sharder import BaseTestSharder, SetTestsContainer |
| 23 from pylib.forwarder import Forwarder |
| 24 from pylib.json_perf_parser import GetAverageRunInfoFromJSONString |
| 25 from pylib.perf_tests_helper import PrintPerfResult |
| 26 from pylib.test_result import SingleTestResult, TestResults |
| 27 |
16 import apk_info | 28 import apk_info |
17 from base_test_runner import BaseTestRunner | 29 |
18 from base_test_sharder import BaseTestSharder, SetTestsContainer | |
19 import cmd_helper | |
20 import constants | |
21 import errors | |
22 from forwarder import Forwarder | |
23 from json_perf_parser import GetAverageRunInfoFromJSONString | |
24 from perf_tests_helper import PrintPerfResult | |
25 import sharded_tests_queue | |
26 from test_result import SingleTestResult, TestResults | |
27 import valgrind_tools | |
28 | 30 |
29 _PERF_TEST_ANNOTATION = 'PerfTest' | 31 _PERF_TEST_ANNOTATION = 'PerfTest' |
30 | 32 |
31 | 33 |
32 class FatalTestException(Exception): | 34 class FatalTestException(Exception): |
33 """A fatal test exception.""" | 35 """A fatal test exception.""" |
34 pass | 36 pass |
35 | 37 |
36 | 38 |
37 def _TestNameToExpectation(test_name): | 39 def _TestNameToExpectation(test_name): |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 | 586 |
585 logging.info('Will run: %s', str(tests)) | 587 logging.info('Will run: %s', str(tests)) |
586 | 588 |
587 if len(attached_devices) > 1 and (coverage or options.wait_for_debugger): | 589 if len(attached_devices) > 1 and (coverage or options.wait_for_debugger): |
588 logging.warning('Coverage / debugger can not be sharded, ' | 590 logging.warning('Coverage / debugger can not be sharded, ' |
589 'using first available device') | 591 'using first available device') |
590 attached_devices = attached_devices[:1] | 592 attached_devices = attached_devices[:1] |
591 sharder = TestSharder(attached_devices, options, tests, apks) | 593 sharder = TestSharder(attached_devices, options, tests, apks) |
592 test_results = sharder.RunShardedTests() | 594 test_results = sharder.RunShardedTests() |
593 return test_results | 595 return test_results |
OLD | NEW |