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 | 5 |
6 import logging | 6 import logging |
7 import os | 7 import os |
8 import re | 8 import re |
9 | 9 |
10 from pylib import constants | 10 from pylib import constants |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 full_test_name, base_test_result.ResultType.FAIL, log=log)) | 172 full_test_name, base_test_result.ResultType.FAIL, log=log)) |
173 except pexpect.EOF: | 173 except pexpect.EOF: |
174 logging.error('Test terminated - EOF') | 174 logging.error('Test terminated - EOF') |
175 # We're here because either the device went offline, or the test harness | 175 # We're here because either the device went offline, or the test harness |
176 # crashed without outputting the CRASHED marker (crbug.com/175538). | 176 # crashed without outputting the CRASHED marker (crbug.com/175538). |
177 if not self.adb.IsOnline(): | 177 if not self.adb.IsOnline(): |
178 raise errors.DeviceUnresponsiveError('Device %s went offline.' % | 178 raise errors.DeviceUnresponsiveError('Device %s went offline.' % |
179 self.device) | 179 self.device) |
180 if full_test_name: | 180 if full_test_name: |
181 results.AddResult(base_test_result.BaseTestResult( | 181 results.AddResult(base_test_result.BaseTestResult( |
182 full_test_name, base_test_result.ResultType.CRASH, log=log)) | 182 full_test_name, base_test_result.ResultType.CRASH, |
| 183 log=p.before.replace('\r', ''))) |
183 except pexpect.TIMEOUT: | 184 except pexpect.TIMEOUT: |
184 logging.error('Test terminated after %d second timeout.', | 185 logging.error('Test terminated after %d second timeout.', |
185 self.timeout) | 186 self.timeout) |
186 if full_test_name: | 187 if full_test_name: |
187 results.AddResult(base_test_result.BaseTestResult( | 188 results.AddResult(base_test_result.BaseTestResult( |
188 full_test_name, base_test_result.ResultType.TIMEOUT, log=log)) | 189 full_test_name, base_test_result.ResultType.TIMEOUT, |
| 190 log=p.before.replace('\r', ''))) |
189 finally: | 191 finally: |
190 p.close() | 192 p.close() |
191 | 193 |
192 ret_code = self._GetGTestReturnCode() | 194 ret_code = self._GetGTestReturnCode() |
193 if ret_code: | 195 if ret_code: |
194 logging.critical( | 196 logging.critical( |
195 'gtest exit code: %d\npexpect.before: %s\npexpect.after: %s', | 197 'gtest exit code: %d\npexpect.before: %s\npexpect.after: %s', |
196 ret_code, p.before, p.after) | 198 ret_code, p.before, p.after) |
197 | 199 |
198 return results | 200 return results |
OLD | NEW |