| 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 re | 7 import re |
| 8 import os | 8 import os |
| 9 import pexpect | 9 import pexpect |
| 10 | 10 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 if found == 2: # re_crash | 165 if found == 2: # re_crash |
| 166 crashed_tests += [BaseTestResult(full_test_name.replace('\r', ''), | 166 crashed_tests += [BaseTestResult(full_test_name.replace('\r', ''), |
| 167 p.before)] | 167 p.before)] |
| 168 overall_fail = True | 168 overall_fail = True |
| 169 break | 169 break |
| 170 # The test failed. | 170 # The test failed. |
| 171 failed_tests += [BaseTestResult(full_test_name.replace('\r', ''), | 171 failed_tests += [BaseTestResult(full_test_name.replace('\r', ''), |
| 172 p.before)] | 172 p.before)] |
| 173 if found >= 3: | 173 if found >= 3: |
| 174 # The test bailed out (i.e., didn't print OK or FAIL). | 174 # The test bailed out (i.e., didn't print OK or FAIL). |
| 175 if found == 3: # pexpect.TIMEOUT | 175 if found == 4: # pexpect.TIMEOUT |
| 176 logging.error('Test terminated after %d second timeout.', | 176 logging.error('Test terminated after %d second timeout.', |
| 177 self.timeout) | 177 self.timeout) |
| 178 timed_out = True | 178 timed_out = True |
| 179 break | 179 break |
| 180 p.close() | 180 p.close() |
| 181 if not self.rebaseline and ready_to_continue: | 181 if not self.rebaseline and ready_to_continue: |
| 182 ok_tests += self._EndGetIOStats(io_stats_before) | 182 ok_tests += self._EndGetIOStats(io_stats_before) |
| 183 ret_code = self._GetGTestReturnCode() | 183 ret_code = self._GetGTestReturnCode() |
| 184 if ret_code: | 184 if ret_code: |
| 185 failed_tests += [BaseTestResult('gtest exit code: %d' % ret_code, | 185 failed_tests += [BaseTestResult('gtest exit code: %d' % ret_code, |
| 186 'pexpect.before: %s' | 186 'pexpect.before: %s' |
| 187 '\npexpect.after: %s' | 187 '\npexpect.after: %s' |
| 188 % (p.before, | 188 % (p.before, |
| 189 p.after))] | 189 p.after))] |
| 190 # Create TestResults and return | 190 # Create TestResults and return |
| 191 return TestResults.FromRun(ok=ok_tests, failed=failed_tests, | 191 return TestResults.FromRun(ok=ok_tests, failed=failed_tests, |
| 192 crashed=crashed_tests, timed_out=timed_out, | 192 crashed=crashed_tests, timed_out=timed_out, |
| 193 overall_fail=overall_fail) | 193 overall_fail=overall_fail) |
| OLD | NEW |