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

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

Issue 1576473002: Android gtest runner: Only query device for test list when necessary (take 2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: indentation fix Created 4 years, 10 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
« no previous file with comments | « no previous file | build/android/pylib/local/device/local_device_gtest_run.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 tempfile 8 import tempfile
9 9
10 from devil.android import apk_helper 10 from devil.android import apk_helper
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 return ret 126 return ret
127 127
128 128
129 class GtestTestInstance(test_instance.TestInstance): 129 class GtestTestInstance(test_instance.TestInstance):
130 130
131 def __init__(self, args, isolate_delegate, error_func): 131 def __init__(self, args, isolate_delegate, error_func):
132 super(GtestTestInstance, self).__init__() 132 super(GtestTestInstance, self).__init__()
133 # TODO(jbudorick): Support multiple test suites. 133 # TODO(jbudorick): Support multiple test suites.
134 if len(args.suite_name) > 1: 134 if len(args.suite_name) > 1:
135 raise ValueError('Platform mode currently supports only 1 gtest suite') 135 raise ValueError('Platform mode currently supports only 1 gtest suite')
136 self._extract_test_list_from_filter = args.extract_test_list_from_filter
137 self._shard_timeout = args.shard_timeout
136 self._suite = args.suite_name[0] 138 self._suite = args.suite_name[0]
137 139
138 self._shard_timeout = args.shard_timeout
139
140 incremental_part = '_incremental' if args.incremental_install else '' 140 incremental_part = '_incremental' if args.incremental_install else ''
141 apk_path = os.path.join( 141 apk_path = os.path.join(
142 constants.GetOutDirectory(), '%s_apk' % self._suite, 142 constants.GetOutDirectory(), '%s_apk' % self._suite,
143 '%s-debug%s.apk' % (self._suite, incremental_part)) 143 '%s-debug%s.apk' % (self._suite, incremental_part))
144 self._exe_path = os.path.join(constants.GetOutDirectory(), 144 self._exe_path = os.path.join(constants.GetOutDirectory(),
145 self._suite) 145 self._suite)
146 if not os.path.exists(apk_path): 146 if not os.path.exists(apk_path):
147 self._apk_helper = None 147 self._apk_helper = None
148 else: 148 else:
149 self._apk_helper = apk_helper.ApkHelper(apk_path) 149 self._apk_helper = apk_helper.ApkHelper(apk_path)
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 return self._shard_timeout 248 return self._shard_timeout
249 249
250 @property 250 @property
251 def suite(self): 251 def suite(self):
252 return self._suite 252 return self._suite
253 253
254 @property 254 @property
255 def test_arguments(self): 255 def test_arguments(self):
256 return self._test_arguments 256 return self._test_arguments
257 257
258 @property
259 def extract_test_list_from_filter(self):
260 return self._extract_test_list_from_filter
261
258 #override 262 #override
259 def TestType(self): 263 def TestType(self):
260 return 'gtest' 264 return 'gtest'
261 265
262 #override 266 #override
263 def SetUp(self): 267 def SetUp(self):
264 """Map data dependencies via isolate.""" 268 """Map data dependencies via isolate."""
265 if self._isolate_delegate: 269 if self._isolate_delegate:
266 self._isolate_delegate.Remap( 270 self._isolate_delegate.Remap(
267 self._isolate_abs_path, self._isolated_abs_path) 271 self._isolate_abs_path, self._isolated_abs_path)
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 result_type = None 364 result_type = None
361 365
362 return results 366 return results
363 367
364 #override 368 #override
365 def TearDown(self): 369 def TearDown(self):
366 """Clear the mappings created by SetUp.""" 370 """Clear the mappings created by SetUp."""
367 if self._isolate_delegate: 371 if self._isolate_delegate:
368 self._isolate_delegate.Clear() 372 self._isolate_delegate.Clear()
369 373
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/local/device/local_device_gtest_run.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698