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

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

Issue 68263025: Android: removes old "keep_test_server_ports". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | build/android/pylib/perf/setup.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 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 """Generates test runner factory and tests for GTests.""" 5 """Generates test runner factory and tests for GTests."""
6 6
7 import fnmatch 7 import fnmatch
8 import glob 8 import glob
9 import logging 9 import logging
10 import os 10 import os
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 def Setup(test_options, devices): 271 def Setup(test_options, devices):
272 """Create the test runner factory and tests. 272 """Create the test runner factory and tests.
273 273
274 Args: 274 Args:
275 test_options: A GTestOptions object. 275 test_options: A GTestOptions object.
276 devices: A list of attached devices. 276 devices: A list of attached devices.
277 277
278 Returns: 278 Returns:
279 A tuple of (TestRunnerFactory, tests). 279 A tuple of (TestRunnerFactory, tests).
280 """ 280 """
281
282 if not ports.ResetTestServerPortAllocation():
283 raise Exception('Failed to reset test server port.')
284
285 test_package = test_package_apk.TestPackageApk(test_options.suite_name) 281 test_package = test_package_apk.TestPackageApk(test_options.suite_name)
286 if not os.path.exists(test_package.suite_path): 282 if not os.path.exists(test_package.suite_path):
287 test_package = test_package_exe.TestPackageExecutable( 283 test_package = test_package_exe.TestPackageExecutable(
288 test_options.suite_name) 284 test_options.suite_name)
289 if not os.path.exists(test_package.suite_path): 285 if not os.path.exists(test_package.suite_path):
290 raise Exception( 286 raise Exception(
291 'Did not find %s target. Ensure it has been built.' 287 'Did not find %s target. Ensure it has been built.'
292 % test_options.suite_name) 288 % test_options.suite_name)
293 logging.warning('Found target %s', test_package.suite_path) 289 logging.warning('Found target %s', test_package.suite_path)
294 290
(...skipping 17 matching lines...) Expand all
312 if test_options.gtest_filter: 308 if test_options.gtest_filter:
313 tests = unittest_util.FilterTestNames(tests, test_options.gtest_filter) 309 tests = unittest_util.FilterTestNames(tests, test_options.gtest_filter)
314 310
315 # Coalesce unit tests into a single test per device 311 # Coalesce unit tests into a single test per device
316 if test_options.suite_name != 'content_browsertests': 312 if test_options.suite_name != 'content_browsertests':
317 num_devices = len(devices) 313 num_devices = len(devices)
318 tests = [':'.join(tests[i::num_devices]) for i in xrange(num_devices)] 314 tests = [':'.join(tests[i::num_devices]) for i in xrange(num_devices)]
319 tests = [t for t in tests if t] 315 tests = [t for t in tests if t]
320 316
321 return (TestRunnerFactory, tests) 317 return (TestRunnerFactory, tests)
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/perf/setup.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698