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 linker tests on a particular device.""" | 5 """Runs linker tests on a particular device.""" |
6 | 6 |
7 import logging | 7 import logging |
8 import os.path | 8 import os.path |
9 import sys | 9 import sys |
10 import traceback | 10 import traceback |
(...skipping 20 matching lines...) Expand all Loading... |
31 exc_info: exception info, ostensibly from sys.exc_info(). | 31 exc_info: exception info, ostensibly from sys.exc_info(). |
32 """ | 32 """ |
33 exc_type, exc_value, exc_traceback = exc_info | 33 exc_type, exc_value, exc_traceback = exc_info |
34 trace_info = ''.join(traceback.format_exception(exc_type, exc_value, | 34 trace_info = ''.join(traceback.format_exception(exc_type, exc_value, |
35 exc_traceback)) | 35 exc_traceback)) |
36 log_msg = 'Exception:\n' + trace_info | 36 log_msg = 'Exception:\n' + trace_info |
37 | 37 |
38 super(LinkerExceptionTestResult, self).__init__( | 38 super(LinkerExceptionTestResult, self).__init__( |
39 test_name, | 39 test_name, |
40 base_test_result.ResultType.FAIL, | 40 base_test_result.ResultType.FAIL, |
41 log = "%s %s" % (exc_type, log_msg)) | 41 log="%s %s" % (exc_type, log_msg)) |
42 | 42 |
43 | 43 |
44 class LinkerTestRunner(base_test_runner.BaseTestRunner): | 44 class LinkerTestRunner(base_test_runner.BaseTestRunner): |
45 """Orchestrates running a set of linker tests. | 45 """Orchestrates running a set of linker tests. |
46 | 46 |
47 Any Python exceptions in the tests are caught and translated into a failed | 47 Any Python exceptions in the tests are caught and translated into a failed |
48 result, rather than being re-raised on the main thread. | 48 result, rather than being re-raised on the main thread. |
49 """ | 49 """ |
50 | 50 |
51 #override | 51 #override |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 test.tagged_name) | 92 test.tagged_name) |
93 exc_info = sys.exc_info() | 93 exc_info = sys.exc_info() |
94 results = base_test_result.TestRunResults() | 94 results = base_test_result.TestRunResults() |
95 results.AddResult(LinkerExceptionTestResult( | 95 results.AddResult(LinkerExceptionTestResult( |
96 test.tagged_name, exc_info)) | 96 test.tagged_name, exc_info)) |
97 | 97 |
98 if not results.DidRunPass(): | 98 if not results.DidRunPass(): |
99 return results, test | 99 return results, test |
100 else: | 100 else: |
101 return results, None | 101 return results, None |
OLD | NEW |