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 """Class for running instrumentation tests on a single device.""" | 5 """Class for running instrumentation tests on a single device.""" |
6 | 6 |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import re | 9 import re |
10 import sys | 10 import sys |
11 import time | 11 import time |
12 | 12 |
| 13 from devil.android import device_errors |
13 from pylib import constants | 14 from pylib import constants |
14 from pylib import flag_changer | 15 from pylib import flag_changer |
15 from pylib import valgrind_tools | 16 from pylib import valgrind_tools |
16 from pylib.base import base_test_result | 17 from pylib.base import base_test_result |
17 from pylib.base import base_test_runner | 18 from pylib.base import base_test_runner |
18 from pylib.device import device_errors | |
19 from pylib.instrumentation import instrumentation_test_instance | 19 from pylib.instrumentation import instrumentation_test_instance |
20 from pylib.instrumentation import json_perf_parser | 20 from pylib.instrumentation import json_perf_parser |
21 from pylib.instrumentation import test_result | 21 from pylib.instrumentation import test_result |
22 from pylib.local.device import local_device_instrumentation_test_run | 22 from pylib.local.device import local_device_instrumentation_test_run |
23 | 23 |
24 sys.path.append(os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib', | 24 sys.path.append(os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib', |
25 'common')) | 25 'common')) |
26 import perf_tests_results_helper # pylint: disable=F0401 | 26 import perf_tests_results_helper # pylint: disable=F0401 |
27 | 27 |
28 | 28 |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 except device_errors.CommandTimeoutError as e: | 363 except device_errors.CommandTimeoutError as e: |
364 results.AddResult(test_result.InstrumentationTestResult( | 364 results.AddResult(test_result.InstrumentationTestResult( |
365 test, base_test_result.ResultType.TIMEOUT, start_ms, duration_ms, | 365 test, base_test_result.ResultType.TIMEOUT, start_ms, duration_ms, |
366 log=str(e) or 'No information')) | 366 log=str(e) or 'No information')) |
367 except device_errors.DeviceUnreachableError as e: | 367 except device_errors.DeviceUnreachableError as e: |
368 results.AddResult(test_result.InstrumentationTestResult( | 368 results.AddResult(test_result.InstrumentationTestResult( |
369 test, base_test_result.ResultType.CRASH, start_ms, duration_ms, | 369 test, base_test_result.ResultType.CRASH, start_ms, duration_ms, |
370 log=str(e) or 'No information')) | 370 log=str(e) or 'No information')) |
371 self.TestTeardown(test, results) | 371 self.TestTeardown(test, results) |
372 return (results, None if results.DidRunPass() else test) | 372 return (results, None if results.DidRunPass() else test) |
OLD | NEW |