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

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

Issue 17151015: [Android] Fix pexpect ordering to get the correct logs. (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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 while True: 148 while True:
149 full_test_name = None 149 full_test_name = None
150 found = p.expect([re_run, re_passed, re_runner_fail], 150 found = p.expect([re_run, re_passed, re_runner_fail],
151 timeout=self.timeout) 151 timeout=self.timeout)
152 if found == 1: # re_passed 152 if found == 1: # re_passed
153 break 153 break
154 elif found == 2: # re_runner_fail 154 elif found == 2: # re_runner_fail
155 break 155 break
156 else: # re_run 156 else: # re_run
157 full_test_name = p.match.group(1).replace('\r', '') 157 full_test_name = p.match.group(1).replace('\r', '')
158 found = p.expect([re_ok, re_fail, re_crash], timeout=self.timeout)
158 log = p.before.replace('\r', '') 159 log = p.before.replace('\r', '')
159 found = p.expect([re_ok, re_fail, re_crash], timeout=self.timeout)
160 if found == 0: # re_ok 160 if found == 0: # re_ok
161 if full_test_name == p.match.group(1).replace('\r', ''): 161 if full_test_name == p.match.group(1).replace('\r', ''):
162 results.AddResult(base_test_result.BaseTestResult( 162 results.AddResult(base_test_result.BaseTestResult(
163 full_test_name, base_test_result.ResultType.PASS, 163 full_test_name, base_test_result.ResultType.PASS,
164 log=log)) 164 log=log))
165 elif found == 2: # re_crash 165 elif found == 2: # re_crash
166 results.AddResult(base_test_result.BaseTestResult( 166 results.AddResult(base_test_result.BaseTestResult(
167 full_test_name, base_test_result.ResultType.CRASH, 167 full_test_name, base_test_result.ResultType.CRASH,
168 log=log)) 168 log=log))
169 break 169 break
(...skipping 19 matching lines...) Expand all
189 finally: 189 finally:
190 p.close() 190 p.close()
191 191
192 ret_code = self._GetGTestReturnCode() 192 ret_code = self._GetGTestReturnCode()
193 if ret_code: 193 if ret_code:
194 logging.critical( 194 logging.critical(
195 'gtest exit code: %d\npexpect.before: %s\npexpect.after: %s', 195 'gtest exit code: %d\npexpect.before: %s\npexpect.after: %s',
196 ret_code, p.before, p.after) 196 ret_code, p.before, p.after)
197 197
198 return results 198 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