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

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

Issue 727543003: [Android] Fix new pylint errors in build/android/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 1 month 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
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 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
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
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()
OLDNEW
« no previous file with comments | « build/android/pylib/device/device_utils_test.py ('k') | build/android/pylib/instrumentation/test_jar.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698