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

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

Issue 1358593002: [Android] Switch gtests to platform mode. (RELAND) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed Created 5 years, 3 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 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 import sys 8 import sys
9 import tempfile 9 import tempfile
10 10
11 from devil.android import apk_helper 11 from devil.android import apk_helper
12 from pylib import constants 12 from pylib import constants
13 from pylib.base import base_test_result 13 from pylib.base import base_test_result
14 from pylib.base import test_instance 14 from pylib.base import test_instance
15 15
16 sys.path.append(os.path.join( 16 sys.path.append(os.path.join(
17 constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib', 'common')) 17 constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib', 'common'))
18 import unittest_util # pylint: disable=import-error 18 import unittest_util # pylint: disable=import-error
19 19
20 20
21 BROWSER_TEST_SUITES = [ 21 BROWSER_TEST_SUITES = [
22 'components_browsertests', 22 'components_browsertests',
23 'content_browsertests', 23 'content_browsertests',
24 ] 24 ]
25 25
26 RUN_IN_SUB_THREAD_TEST_SUITES = ['net_unittests']
27
26 28
27 _DEFAULT_ISOLATE_FILE_PATHS = { 29 _DEFAULT_ISOLATE_FILE_PATHS = {
28 'base_unittests': 'base/base_unittests.isolate', 30 'base_unittests': 'base/base_unittests.isolate',
29 'blink_heap_unittests': 31 'blink_heap_unittests':
30 'third_party/WebKit/Source/platform/heap/BlinkHeapUnitTests.isolate', 32 'third_party/WebKit/Source/platform/heap/BlinkHeapUnitTests.isolate',
31 'breakpad_unittests': 'breakpad/breakpad_unittests.isolate', 33 'breakpad_unittests': 'breakpad/breakpad_unittests.isolate',
32 'cc_perftests': 'cc/cc_perftests.isolate', 34 'cc_perftests': 'cc/cc_perftests.isolate',
33 'components_browsertests': 'components/components_browsertests.isolate', 35 'components_browsertests': 'components/components_browsertests.isolate',
34 'components_unittests': 'components/components_unittests.isolate', 36 'components_unittests': 'components/components_unittests.isolate',
35 'content_browsertests': 'content/content_browsertests.isolate', 37 'content_browsertests': 'content/content_browsertests.isolate',
(...skipping 30 matching lines...) Expand all
66 'third_party/hunspell_dictionaries/*.dic', 68 'third_party/hunspell_dictionaries/*.dic',
67 # crbug.com/258690 69 # crbug.com/258690
68 'webkit/data/bmp_decoder', 70 'webkit/data/bmp_decoder',
69 'webkit/data/ico_decoder', 71 'webkit/data/ico_decoder',
70 ] 72 ]
71 73
72 74
73 _EXTRA_NATIVE_TEST_ACTIVITY = ( 75 _EXTRA_NATIVE_TEST_ACTIVITY = (
74 'org.chromium.native_test.NativeTestInstrumentationTestRunner.' 76 'org.chromium.native_test.NativeTestInstrumentationTestRunner.'
75 'NativeTestActivity') 77 'NativeTestActivity')
78 _EXTRA_RUN_IN_SUB_THREAD = (
79 'org.chromium.native_test.NativeTestActivity.RunInSubThread')
76 _EXTRA_SHARD_SIZE_LIMIT = ( 80 _EXTRA_SHARD_SIZE_LIMIT = (
77 'org.chromium.native_test.NativeTestInstrumentationTestRunner.' 81 'org.chromium.native_test.NativeTestInstrumentationTestRunner.'
78 'ShardSizeLimit') 82 'ShardSizeLimit')
79 83
80 # TODO(jbudorick): Remove these once we're no longer parsing stdout to generate 84 # TODO(jbudorick): Remove these once we're no longer parsing stdout to generate
81 # results. 85 # results.
82 _RE_TEST_STATUS = re.compile( 86 _RE_TEST_STATUS = re.compile(
83 r'\[ +((?:RUN)|(?:FAILED)|(?:OK)) +\] ?([^ ]+)(?: \((\d+) ms\))?$') 87 r'\[ +((?:RUN)|(?:FAILED)|(?:OK)) +\] ?([^ ]+)(?: \((\d+) ms\))?$')
84 _RE_TEST_RUN_STATUS = re.compile( 88 _RE_TEST_RUN_STATUS = re.compile(
85 r'\[ +(PASSED|RUNNER_FAILED|CRASHED) \] ?[^ ]+') 89 r'\[ +(PASSED|RUNNER_FAILED|CRASHED) \] ?[^ ]+')
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 self._runner = None 145 self._runner = None
142 else: 146 else:
143 helper = apk_helper.ApkHelper(self._apk_path) 147 helper = apk_helper.ApkHelper(self._apk_path)
144 self._activity = helper.GetActivityName() 148 self._activity = helper.GetActivityName()
145 self._package = helper.GetPackageName() 149 self._package = helper.GetPackageName()
146 self._runner = helper.GetInstrumentationName() 150 self._runner = helper.GetInstrumentationName()
147 self._permissions = helper.GetPermissions() 151 self._permissions = helper.GetPermissions()
148 self._extras = { 152 self._extras = {
149 _EXTRA_NATIVE_TEST_ACTIVITY: self._activity, 153 _EXTRA_NATIVE_TEST_ACTIVITY: self._activity,
150 } 154 }
155 if self._suite in RUN_IN_SUB_THREAD_TEST_SUITES:
156 self._extras[_EXTRA_RUN_IN_SUB_THREAD] = 1
151 if self._suite in BROWSER_TEST_SUITES: 157 if self._suite in BROWSER_TEST_SUITES:
152 self._extras[_EXTRA_SHARD_SIZE_LIMIT] = 1 158 self._extras[_EXTRA_SHARD_SIZE_LIMIT] = 1
153 159
154 if not os.path.exists(self._exe_path): 160 if not os.path.exists(self._exe_path):
155 self._exe_path = None 161 self._exe_path = None
156 if not self._apk_path and not self._exe_path: 162 if not self._apk_path and not self._exe_path:
157 error_func('Could not find apk or executable for %s' % self._suite) 163 error_func('Could not find apk or executable for %s' % self._suite)
158 164
159 self._data_deps = [] 165 self._data_deps = []
160 if args.test_filter: 166 if args.test_filter:
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 return self._permissions 331 return self._permissions
326 332
327 @property 333 @property
328 def runner(self): 334 def runner(self):
329 return self._runner 335 return self._runner
330 336
331 @property 337 @property
332 def suite(self): 338 def suite(self):
333 return self._suite 339 return self._suite
334 340
OLDNEW
« no previous file with comments | « build/android/pylib/base/test_run_factory.py ('k') | build/android/pylib/gtest/local_device_gtest_run.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698