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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
330 # Creates a temporary AVD for the extra emulators. | 330 # Creates a temporary AVD for the extra emulators. |
331 avd_name = 'run_tests_avd_%d' % n | 331 avd_name = 'run_tests_avd_%d' % n |
332 buildbot_emulator = emulator.Emulator(avd_name, options.fast_and_loose) | 332 buildbot_emulator = emulator.Emulator(avd_name, options.fast_and_loose) |
333 buildbot_emulator.Launch(kill_all_emulators=n == 0) | 333 buildbot_emulator.Launch(kill_all_emulators=n == 0) |
334 t.Stop() | 334 t.Stop() |
335 buildbot_emulators.append(buildbot_emulator) | 335 buildbot_emulators.append(buildbot_emulator) |
336 attached_devices.append(buildbot_emulator.device) | 336 attached_devices.append(buildbot_emulator.device) |
337 # Wait for all emulators to boot completed. | 337 # Wait for all emulators to boot completed. |
338 map(lambda buildbot_emulator: buildbot_emulator.ConfirmLaunch(True), | 338 map(lambda buildbot_emulator: buildbot_emulator.ConfirmLaunch(True), |
339 buildbot_emulators) | 339 buildbot_emulators) |
340 # Restart adb server as emulator will reset connection when booting, | |
341 # which will break the connection between adb server and emulator. | |
bulach
2012/07/17 10:26:08
the comment seems to indicate this is needed per e
John Grabowski
2012/07/17 18:09:22
agree
Wei James(wistoch)
2012/07/20 04:07:01
after applying several patches of bulach, I run th
| |
342 android_commands.RestartAdbServer() | |
340 elif options.test_device: | 343 elif options.test_device: |
341 attached_devices = [options.test_device] | 344 attached_devices = [options.test_device] |
342 else: | 345 else: |
343 attached_devices = android_commands.GetAttachedDevices() | 346 attached_devices = android_commands.GetAttachedDevices() |
344 | 347 |
345 if not attached_devices: | 348 if not attached_devices: |
346 logging.critical('A device must be attached and online.') | 349 logging.critical('A device must be attached and online.') |
347 buildbot_report.PrintError() | 350 buildbot_report.PrintError() |
348 return 1 | 351 return 1 |
349 | 352 |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
492 # the batch (this happens because the exit status is a sum of all failures | 495 # the batch (this happens because the exit status is a sum of all failures |
493 # from all suites, but the buildbot associates the exit status only with the | 496 # from all suites, but the buildbot associates the exit status only with the |
494 # most recent step). | 497 # most recent step). |
495 if options.exit_code: | 498 if options.exit_code: |
496 return failed_tests_count | 499 return failed_tests_count |
497 return 0 | 500 return 0 |
498 | 501 |
499 | 502 |
500 if __name__ == '__main__': | 503 if __name__ == '__main__': |
501 sys.exit(main(sys.argv)) | 504 sys.exit(main(sys.argv)) |
OLD | NEW |