| 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 import logging | 5 import logging |
| 6 import os | 6 import os |
| 7 import re | 7 import re |
| 8 | 8 |
| 9 from pylib import pexpect | 9 from pylib import pexpect |
| 10 from pylib import ports | 10 from pylib import ports |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 Args: | 72 Args: |
| 73 p: An instance of pexpect spawn class. | 73 p: An instance of pexpect spawn class. |
| 74 | 74 |
| 75 Returns: | 75 Returns: |
| 76 A TestRunResults object. | 76 A TestRunResults object. |
| 77 """ | 77 """ |
| 78 results = base_test_result.TestRunResults() | 78 results = base_test_result.TestRunResults() |
| 79 | 79 |
| 80 # Test case statuses. | 80 # Test case statuses. |
| 81 re_run = re.compile('\[ RUN \] ?(.*)\r\n') | 81 re_run = re.compile('\\[ RUN \\] ?(.*)\r\n') |
| 82 re_fail = re.compile('\[ FAILED \] ?(.*?)( \((\d+) ms\))?\r\r\n') | 82 re_fail = re.compile('\\[ FAILED \\] ?(.*?)( \\((\\d+) ms\\))?\r\r\n') |
| 83 re_ok = re.compile('\[ OK \] ?(.*?)( \((\d+) ms\))?\r\r\n') | 83 re_ok = re.compile('\\[ OK \\] ?(.*?)( \\((\\d+) ms\\))?\r\r\n') |
| 84 | 84 |
| 85 # Test run statuses. | 85 # Test run statuses. |
| 86 re_passed = re.compile('\[ PASSED \] ?(.*)\r\n') | 86 re_passed = re.compile('\\[ PASSED \\] ?(.*)\r\n') |
| 87 re_runner_fail = re.compile('\[ RUNNER_FAILED \] ?(.*)\r\n') | 87 re_runner_fail = re.compile('\\[ RUNNER_FAILED \\] ?(.*)\r\n') |
| 88 # Signal handlers are installed before starting tests | 88 # Signal handlers are installed before starting tests |
| 89 # to output the CRASHED marker when a crash happens. | 89 # to output the CRASHED marker when a crash happens. |
| 90 re_crash = re.compile('\[ CRASHED \](.*)\r\n') | 90 re_crash = re.compile('\\[ CRASHED \\](.*)\r\n') |
| 91 | 91 |
| 92 log = '' | 92 log = '' |
| 93 try: | 93 try: |
| 94 while True: | 94 while True: |
| 95 full_test_name = None | 95 full_test_name = None |
| 96 | 96 |
| 97 found = p.expect([re_run, re_passed, re_runner_fail], | 97 found = p.expect([re_run, re_passed, re_runner_fail], |
| 98 timeout=self._timeout) | 98 timeout=self._timeout) |
| 99 if found == 1: # re_passed | 99 if found == 1: # re_passed |
| 100 break | 100 break |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 #override | 187 #override |
| 188 def TearDown(self): | 188 def TearDown(self): |
| 189 """Cleans up the test enviroment for the test suite.""" | 189 """Cleans up the test enviroment for the test suite.""" |
| 190 for s in self._servers: | 190 for s in self._servers: |
| 191 s.TearDown() | 191 s.TearDown() |
| 192 if _TestSuiteRequiresHighPerfMode(self.test_package.suite_name): | 192 if _TestSuiteRequiresHighPerfMode(self.test_package.suite_name): |
| 193 self._perf_controller.SetDefaultPerfMode() | 193 self._perf_controller.SetDefaultPerfMode() |
| 194 self.test_package.ClearApplicationState(self.device) | 194 self.test_package.ClearApplicationState(self.device) |
| 195 self.tool.CleanUpEnvironment() | 195 self.tool.CleanUpEnvironment() |
| 196 super(TestRunner, self).TearDown() | 196 super(TestRunner, self).TearDown() |
| OLD | NEW |