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

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

Issue 10692132: fix test broken issue when using --use-emulator (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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
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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 buildbot_emulators = [] 321 buildbot_emulators = []
322 322
323 if options.use_emulator: 323 if options.use_emulator:
324 for n in range(options.use_emulator): 324 for n in range(options.use_emulator):
325 t = TimeProfile('Emulator launch %d' % n) 325 t = TimeProfile('Emulator launch %d' % n)
326 buildbot_emulator = emulator.Emulator(options.fast_and_loose) 326 buildbot_emulator = emulator.Emulator(options.fast_and_loose)
327 buildbot_emulator.Launch(kill_all_emulators=n == 0) 327 buildbot_emulator.Launch(kill_all_emulators=n == 0)
328 t.Stop() 328 t.Stop()
329 buildbot_emulators.append(buildbot_emulator) 329 buildbot_emulators.append(buildbot_emulator)
330 attached_devices.append(buildbot_emulator.device) 330 attached_devices.append(buildbot_emulator.device)
331 # Wait for all emulators to become available. 331 # Wait for all emulators to boot completed.
332 map(lambda buildbot_emulator:buildbot_emulator.ConfirmLaunch(), 332 map(lambda buildbot_emulator:buildbot_emulator.ConfirmLaunch(True),
333 buildbot_emulators) 333 buildbot_emulators)
334 elif options.test_device: 334 elif options.test_device:
335 attached_devices = [options.test_device] 335 attached_devices = [options.test_device]
336 else: 336 else:
337 attached_devices = android_commands.GetAttachedDevices() 337 attached_devices = android_commands.GetAttachedDevices()
338 338
339 if not attached_devices: 339 if not attached_devices:
340 logging.critical('A device must be attached and online.') 340 logging.critical('A device must be attached and online.')
341 if options.annotate: 341 if options.annotate:
342 print '@@@STEP_FAILURE@@@' 342 print '@@@STEP_FAILURE@@@'
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 # from all suites, but the buildbot associates the exit status only with the 486 # from all suites, but the buildbot associates the exit status only with the
487 # most recent step). 487 # most recent step).
488 if options.annotate: 488 if options.annotate:
489 return 0 489 return 0
490 else: 490 else:
491 return failed_tests_count 491 return failed_tests_count
492 492
493 493
494 if __name__ == '__main__': 494 if __name__ == '__main__':
495 sys.exit(main(sys.argv)) 495 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « build/android/pylib/single_test_runner.py ('k') | third_party/android_testrunner/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698