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.host_driven import test_case | |
15 from pylib.instrumentation import test_result | 14 from pylib.instrumentation import test_result |
16 | 15 |
| 16 import test_case |
| 17 |
17 | 18 |
18 class HostDrivenExceptionTestResult(test_result.InstrumentationTestResult): | 19 class HostDrivenExceptionTestResult(test_result.InstrumentationTestResult): |
19 """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.""" |
20 | 21 |
21 def __init__(self, test_name, start_date_ms, exc_info): | 22 def __init__(self, test_name, start_date_ms, exc_info): |
22 """Constructs a HostDrivenExceptionTestResult object. | 23 """Constructs a HostDrivenExceptionTestResult object. |
23 | 24 |
24 Args: | 25 Args: |
25 test_name: name of the test which raised an exception. | 26 test_name: name of the test which raised an exception. |
26 start_date_ms: the starting time for the test. | 27 start_date_ms: the starting time for the test. |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 # until the test is fixed. | 125 # until the test is fixed. |
125 exc_info = sys.exc_info() | 126 exc_info = sys.exc_info() |
126 results = base_test_result.TestRunResults() | 127 results = base_test_result.TestRunResults() |
127 results.AddResult(HostDrivenExceptionTestResult( | 128 results.AddResult(HostDrivenExceptionTestResult( |
128 test.tagged_name, start_date_ms, exc_info)) | 129 test.tagged_name, start_date_ms, exc_info)) |
129 | 130 |
130 if not results.DidRunPass(): | 131 if not results.DidRunPass(): |
131 return results, test | 132 return results, test |
132 else: | 133 else: |
133 return results, None | 134 return results, None |
OLD | NEW |