Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: build/android/pylib/gtest/test_package.py

Issue 17484004: android: Always initialize 'log' variable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 re_fail = re.compile('\[ FAILED \] ?(.*)\r\n') 137 re_fail = re.compile('\[ FAILED \] ?(.*)\r\n')
138 re_ok = re.compile('\[ OK \] ?(.*?) .*\r\n') 138 re_ok = re.compile('\[ OK \] ?(.*?) .*\r\n')
139 139
140 # Test run statuses. 140 # Test run statuses.
141 re_passed = re.compile('\[ PASSED \] ?(.*)\r\n') 141 re_passed = re.compile('\[ PASSED \] ?(.*)\r\n')
142 re_runner_fail = re.compile('\[ RUNNER_FAILED \] ?(.*)\r\n') 142 re_runner_fail = re.compile('\[ RUNNER_FAILED \] ?(.*)\r\n')
143 # Signal handlers are installed before starting tests 143 # Signal handlers are installed before starting tests
144 # to output the CRASHED marker when a crash happens. 144 # to output the CRASHED marker when a crash happens.
145 re_crash = re.compile('\[ CRASHED \](.*)\r\n') 145 re_crash = re.compile('\[ CRASHED \](.*)\r\n')
146 146
147 log = ''
147 try: 148 try:
148 while True: 149 while True:
149 full_test_name = None 150 full_test_name = None
150 found = p.expect([re_run, re_passed, re_runner_fail], 151 found = p.expect([re_run, re_passed, re_runner_fail],
151 timeout=self.timeout) 152 timeout=self.timeout)
152 if found == 1: # re_passed 153 if found == 1: # re_passed
153 break 154 break
154 elif found == 2: # re_runner_fail 155 elif found == 2: # re_runner_fail
155 break 156 break
156 else: # re_run 157 else: # re_run
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 finally: 190 finally:
190 p.close() 191 p.close()
191 192
192 ret_code = self._GetGTestReturnCode() 193 ret_code = self._GetGTestReturnCode()
193 if ret_code: 194 if ret_code:
194 logging.critical( 195 logging.critical(
195 'gtest exit code: %d\npexpect.before: %s\npexpect.after: %s', 196 'gtest exit code: %d\npexpect.before: %s\npexpect.after: %s',
196 ret_code, p.before, p.after) 197 ret_code, p.before, p.after)
197 198
198 return results 199 return results
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698