OLD | NEW |
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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 buildbot_emulators = [] | 312 buildbot_emulators = [] |
313 | 313 |
314 if options.use_emulator: | 314 if options.use_emulator: |
315 for n in range(options.use_emulator): | 315 for n in range(options.use_emulator): |
316 t = TimeProfile('Emulator launch %d' % n) | 316 t = TimeProfile('Emulator launch %d' % n) |
317 buildbot_emulator = emulator.Emulator(options.fast_and_loose) | 317 buildbot_emulator = emulator.Emulator(options.fast_and_loose) |
318 buildbot_emulator.Launch(kill_all_emulators=n == 0) | 318 buildbot_emulator.Launch(kill_all_emulators=n == 0) |
319 t.Stop() | 319 t.Stop() |
320 buildbot_emulators.append(buildbot_emulator) | 320 buildbot_emulators.append(buildbot_emulator) |
321 attached_devices.append(buildbot_emulator.device) | 321 attached_devices.append(buildbot_emulator.device) |
322 # Wait for all emulators to become available. | 322 # Wait for all emulators to boot completed. |
323 map(lambda buildbot_emulator:buildbot_emulator.ConfirmLaunch(), | 323 map(lambda buildbot_emulator:buildbot_emulator.ConfirmLaunch(True), |
324 buildbot_emulators) | 324 buildbot_emulators) |
325 elif options.test_device: | 325 elif options.test_device: |
326 attached_devices = [options.test_device] | 326 attached_devices = [options.test_device] |
327 else: | 327 else: |
328 attached_devices = android_commands.GetAttachedDevices() | 328 attached_devices = android_commands.GetAttachedDevices() |
329 | 329 |
330 if not attached_devices: | 330 if not attached_devices: |
331 logging.critical('A device must be attached and online.') | 331 logging.critical('A device must be attached and online.') |
332 if options.annotate: | 332 if options.annotate: |
333 print '@@@STEP_FAILURE@@@' | 333 print '@@@STEP_FAILURE@@@' |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 # from all suites, but the buildbot associates the exit status only with the | 472 # from all suites, but the buildbot associates the exit status only with the |
473 # most recent step). | 473 # most recent step). |
474 if options.annotate: | 474 if options.annotate: |
475 return 0 | 475 return 0 |
476 else: | 476 else: |
477 return failed_tests_count | 477 return failed_tests_count |
478 | 478 |
479 | 479 |
480 if __name__ == '__main__': | 480 if __name__ == '__main__': |
481 sys.exit(main(sys.argv)) | 481 sys.exit(main(sys.argv)) |
OLD | NEW |