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

Side by Side Diff: build/android/run_tests.py

Issue 10784011: create temp avd when running tests on multiple emulators (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix for bulach's comments Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « build/android/emulator.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Runs all the native unit tests. 7 """Runs all the native unit tests.
8 8
9 1. Copy over test binary to /data/local on device. 9 1. Copy over test binary to /data/local on device.
10 2. Resources: chrome/unit_tests requires resources (chrome.pak and en-US.pak) 10 2. Resources: chrome/unit_tests requires resources (chrome.pak and en-US.pak)
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 318
319 Returns: 319 Returns:
320 0 if successful, number of failing tests otherwise. 320 0 if successful, number of failing tests otherwise.
321 """ 321 """
322 attached_devices = [] 322 attached_devices = []
323 buildbot_emulators = [] 323 buildbot_emulators = []
324 324
325 if options.use_emulator: 325 if options.use_emulator:
326 for n in range(options.use_emulator): 326 for n in range(options.use_emulator):
327 t = TimeProfile('Emulator launch %d' % n) 327 t = TimeProfile('Emulator launch %d' % n)
328 buildbot_emulator = emulator.Emulator(options.fast_and_loose) 328 avd_name = None
329 if n > 0:
330 # Creates a temporary AVD for the extra emulators.
331 avd_name = 'run_tests_avd_%d' % n
332 buildbot_emulator = emulator.Emulator(avd_name, options.fast_and_loose)
329 buildbot_emulator.Launch(kill_all_emulators=n == 0) 333 buildbot_emulator.Launch(kill_all_emulators=n == 0)
330 t.Stop() 334 t.Stop()
331 buildbot_emulators.append(buildbot_emulator) 335 buildbot_emulators.append(buildbot_emulator)
332 attached_devices.append(buildbot_emulator.device) 336 attached_devices.append(buildbot_emulator.device)
333 # Wait for all emulators to boot completed. 337 # Wait for all emulators to boot completed.
334 map(lambda buildbot_emulator: buildbot_emulator.ConfirmLaunch(True), 338 map(lambda buildbot_emulator: buildbot_emulator.ConfirmLaunch(True),
335 buildbot_emulators) 339 buildbot_emulators)
336 elif options.test_device: 340 elif options.test_device:
337 attached_devices = [options.test_device] 341 attached_devices = [options.test_device]
338 else: 342 else:
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 # the batch (this happens because the exit status is a sum of all failures 489 # the batch (this happens because the exit status is a sum of all failures
486 # from all suites, but the buildbot associates the exit status only with the 490 # from all suites, but the buildbot associates the exit status only with the
487 # most recent step). 491 # most recent step).
488 if options.exit_code: 492 if options.exit_code:
489 return failed_tests_count 493 return failed_tests_count
490 return 0 494 return 0
491 495
492 496
493 if __name__ == '__main__': 497 if __name__ == '__main__':
494 sys.exit(main(sys.argv)) 498 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « build/android/emulator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698