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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 if n == 0 else 'run_tests_avd_%d' % n |
bulach
2012/07/16 11:39:13
maybe clearer as:
avd_name = None
if n > 0:
# Cr
Wei James(wistoch)
2012/07/16 13:04:38
fixed. thanks
| |
329 buildbot_emulator = emulator.Emulator(avd_name, options.fast_and_loose) | |
329 buildbot_emulator.Launch(kill_all_emulators=n == 0) | 330 buildbot_emulator.Launch(kill_all_emulators=n == 0) |
330 t.Stop() | 331 t.Stop() |
331 buildbot_emulators.append(buildbot_emulator) | 332 buildbot_emulators.append(buildbot_emulator) |
332 attached_devices.append(buildbot_emulator.device) | 333 attached_devices.append(buildbot_emulator.device) |
333 # Wait for all emulators to boot completed. | 334 # Wait for all emulators to boot completed. |
334 map(lambda buildbot_emulator: buildbot_emulator.ConfirmLaunch(True), | 335 map(lambda buildbot_emulator: buildbot_emulator.ConfirmLaunch(True), |
335 buildbot_emulators) | 336 buildbot_emulators) |
336 elif options.test_device: | 337 elif options.test_device: |
337 attached_devices = [options.test_device] | 338 attached_devices = [options.test_device] |
338 else: | 339 else: |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
485 # the batch (this happens because the exit status is a sum of all failures | 486 # 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 | 487 # from all suites, but the buildbot associates the exit status only with the |
487 # most recent step). | 488 # most recent step). |
488 if options.exit_code: | 489 if options.exit_code: |
489 return failed_tests_count | 490 return failed_tests_count |
490 return 0 | 491 return 0 |
491 | 492 |
492 | 493 |
493 if __name__ == '__main__': | 494 if __name__ == '__main__': |
494 sys.exit(main(sys.argv)) | 495 sys.exit(main(sys.argv)) |
OLD | NEW |