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

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: alphebetize a couple things Created 4 years, 11 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
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 return ret 127 return ret
128 128
129 129
130 class GtestTestInstance(test_instance.TestInstance): 130 class GtestTestInstance(test_instance.TestInstance):
131 131
132 def __init__(self, args, isolate_delegate, error_func): 132 def __init__(self, args, isolate_delegate, error_func):
133 super(GtestTestInstance, self).__init__() 133 super(GtestTestInstance, self).__init__()
134 # TODO(jbudorick): Support multiple test suites. 134 # TODO(jbudorick): Support multiple test suites.
135 if len(args.suite_name) > 1: 135 if len(args.suite_name) > 1:
136 raise ValueError('Platform mode currently supports only 1 gtest suite') 136 raise ValueError('Platform mode currently supports only 1 gtest suite')
137 self._extract_test_list_from_filter = args.extract_test_list_from_filter
138 self._shard_timeout = args.shard_timeout
137 self._suite = args.suite_name[0] 139 self._suite = args.suite_name[0]
138 140
139 self._shard_timeout = args.shard_timeout
140
141 incremental_part = '_incremental' if args.incremental_install else '' 141 incremental_part = '_incremental' if args.incremental_install else ''
142 apk_path = os.path.join( 142 apk_path = os.path.join(
143 constants.GetOutDirectory(), '%s_apk' % self._suite, 143 constants.GetOutDirectory(), '%s_apk' % self._suite,
144 '%s-debug%s.apk' % (self._suite, incremental_part)) 144 '%s-debug%s.apk' % (self._suite, incremental_part))
145 self._exe_path = os.path.join(constants.GetOutDirectory(), 145 self._exe_path = os.path.join(constants.GetOutDirectory(),
146 self._suite) 146 self._suite)
147 if not os.path.exists(apk_path): 147 if not os.path.exists(apk_path):
148 self._apk_helper = None 148 self._apk_helper = None
149 else: 149 else:
150 self._apk_helper = apk_helper.ApkHelper(apk_path) 150 self._apk_helper = apk_helper.ApkHelper(apk_path)
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 return self._shard_timeout 249 return self._shard_timeout
250 250
251 @property 251 @property
252 def suite(self): 252 def suite(self):
253 return self._suite 253 return self._suite
254 254
255 @property 255 @property
256 def test_arguments(self): 256 def test_arguments(self):
257 return self._test_arguments 257 return self._test_arguments
258 258
259 @property
260 def extract_test_list_from_filter(self):
261 return self._extract_test_list_from_filter
262
259 #override 263 #override
260 def TestType(self): 264 def TestType(self):
261 return 'gtest' 265 return 'gtest'
262 266
263 #override 267 #override
264 def SetUp(self): 268 def SetUp(self):
265 """Map data dependencies via isolate.""" 269 """Map data dependencies via isolate."""
266 if self._isolate_delegate: 270 if self._isolate_delegate:
267 self._isolate_delegate.Remap( 271 self._isolate_delegate.Remap(
268 self._isolate_abs_path, self._isolated_abs_path) 272 self._isolate_abs_path, self._isolated_abs_path)
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 result_type = None 365 result_type = None
362 366
363 return results 367 return results
364 368
365 #override 369 #override
366 def TearDown(self): 370 def TearDown(self):
367 """Clear the mappings created by SetUp.""" 371 """Clear the mappings created by SetUp."""
368 if self._isolate_delegate: 372 if self._isolate_delegate:
369 self._isolate_delegate.Clear() 373 self._isolate_delegate.Clear()
370 374
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/local/device/local_device_gtest_run.py » ('j') | build/android/test_runner.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698