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

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

Issue 1126543009: [Android] Refactor the native test wrappers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
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
11 from pylib.base import base_test_result 11 from pylib.base import base_test_result
12 from pylib.base import base_test_runner 12 from pylib.base import base_test_runner
13 from pylib.device import device_errors 13 from pylib.device import device_errors
14 from pylib.gtest import gtest_test_instance
14 from pylib.local import local_test_server_spawner 15 from pylib.local import local_test_server_spawner
15 from pylib.perf import perf_control 16 from pylib.perf import perf_control
16 17
17 # Test case statuses. 18 # Test case statuses.
18 RE_RUN = re.compile('\\[ RUN \\] ?(.*)\r\n') 19 RE_RUN = re.compile('\\[ RUN \\] ?(.*)\r\n')
19 RE_FAIL = re.compile('\\[ FAILED \\] ?(.*?)( \\((\\d+) ms\\))?\r\r\n') 20 RE_FAIL = re.compile('\\[ FAILED \\] ?(.*?)( \\((\\d+) ms\\))?\r\r\n')
20 RE_OK = re.compile('\\[ OK \\] ?(.*?)( \\((\\d+) ms\\))?\r\r\n') 21 RE_OK = re.compile('\\[ OK \\] ?(.*?)( \\((\\d+) ms\\))?\r\r\n')
21 22
22 # Test run statuses. 23 # Test run statuses.
23 RE_PASSED = re.compile('\\[ PASSED \\] ?(.*)\r\n') 24 RE_PASSED = re.compile('\\[ PASSED \\] ?(.*)\r\n')
(...skipping 28 matching lines...) Expand all
52 test_options: A GTestOptions object. 53 test_options: A GTestOptions object.
53 device: Device to run the tests. 54 device: Device to run the tests.
54 test_package: An instance of TestPackage class. 55 test_package: An instance of TestPackage class.
55 """ 56 """
56 57
57 super(TestRunner, self).__init__(device, test_options.tool) 58 super(TestRunner, self).__init__(device, test_options.tool)
58 59
59 self.test_package = test_package 60 self.test_package = test_package
60 self.test_package.tool = self.tool 61 self.test_package.tool = self.tool
61 self._test_arguments = test_options.test_arguments 62 self._test_arguments = test_options.test_arguments
63 if self.test_package.suite_name in gtest_test_instance.BROWSER_TEST_SUITES:
64 self._test_arguments += (
65 ' ' + ' '.join(gtest_test_instance.BROWSER_TEST_FLAGS))
62 66
63 timeout = test_options.timeout 67 timeout = test_options.timeout
64 if timeout == 0: 68 if timeout == 0:
65 timeout = 60 69 timeout = 60
66 # On a VM (e.g. chromium buildbots), this timeout is way too small. 70 # On a VM (e.g. chromium buildbots), this timeout is way too small.
67 if os.environ.get('BUILDBOT_SLAVENAME'): 71 if os.environ.get('BUILDBOT_SLAVENAME'):
68 timeout = timeout * 2 72 timeout = timeout * 2
69 73
70 self._timeout = min(timeout * self.tool.GetTimeoutScale(), 74 self._timeout = min(timeout * self.tool.GetTimeoutScale(),
71 _INFRA_STDOUT_TIMEOUT) 75 _INFRA_STDOUT_TIMEOUT)
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 #override 196 #override
193 def TearDown(self): 197 def TearDown(self):
194 """Cleans up the test enviroment for the test suite.""" 198 """Cleans up the test enviroment for the test suite."""
195 for s in self._servers: 199 for s in self._servers:
196 s.TearDown() 200 s.TearDown()
197 if _TestSuiteRequiresHighPerfMode(self.test_package.suite_name): 201 if _TestSuiteRequiresHighPerfMode(self.test_package.suite_name):
198 self._perf_controller.SetDefaultPerfMode() 202 self._perf_controller.SetDefaultPerfMode()
199 self.test_package.ClearApplicationState(self.device) 203 self.test_package.ClearApplicationState(self.device)
200 self.tool.CleanUpEnvironment() 204 self.tool.CleanUpEnvironment()
201 super(TestRunner, self).TearDown() 205 super(TestRunner, self).TearDown()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698