OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 host-driven tests on a particular device.""" | 5 """Runs host-driven tests on a particular device.""" |
6 | 6 |
7 import logging | 7 import logging |
8 import sys | 8 import sys |
9 import time | 9 import time |
10 import traceback | 10 import traceback |
11 | 11 |
12 from pylib.base import base_test_result | 12 from pylib.base import base_test_result |
13 from pylib.base import base_test_runner | 13 from pylib.base import base_test_runner |
14 from pylib.instrumentation import test_result | 14 from pylib.instrumentation import test_result |
15 | 15 |
16 import test_case | 16 from . import test_case |
17 | 17 |
18 | 18 |
19 class HostDrivenExceptionTestResult(test_result.InstrumentationTestResult): | 19 class HostDrivenExceptionTestResult(test_result.InstrumentationTestResult): |
20 """Test result corresponding to a python exception in a host-driven test.""" | 20 """Test result corresponding to a python exception in a host-driven test.""" |
21 | 21 |
22 def __init__(self, test_name, start_date_ms, exc_info): | 22 def __init__(self, test_name, start_date_ms, exc_info): |
23 """Constructs a HostDrivenExceptionTestResult object. | 23 """Constructs a HostDrivenExceptionTestResult object. |
24 | 24 |
25 Args: | 25 Args: |
26 test_name: name of the test which raised an exception. | 26 test_name: name of the test which raised an exception. |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 # until the test is fixed. | 125 # until the test is fixed. |
126 exc_info = sys.exc_info() | 126 exc_info = sys.exc_info() |
127 results = base_test_result.TestRunResults() | 127 results = base_test_result.TestRunResults() |
128 results.AddResult(HostDrivenExceptionTestResult( | 128 results.AddResult(HostDrivenExceptionTestResult( |
129 test.tagged_name, start_date_ms, exc_info)) | 129 test.tagged_name, start_date_ms, exc_info)) |
130 | 130 |
131 if not results.DidRunPass(): | 131 if not results.DidRunPass(): |
132 return results, test | 132 return results, test |
133 else: | 133 else: |
134 return results, None | 134 return results, None |
OLD | NEW |