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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 'of failures.') | 419 'of failures.') |
420 option_parser.add_option('--exe', action='store_true', | 420 option_parser.add_option('--exe', action='store_true', |
421 help='If set, use the exe test runner instead of ' | 421 help='If set, use the exe test runner instead of ' |
422 'the APK.') | 422 'the APK.') |
423 options, args = option_parser.parse_args(argv) | 423 options, args = option_parser.parse_args(argv) |
424 if len(args) > 1: | 424 if len(args) > 1: |
425 print 'Unknown argument:', args[1:] | 425 print 'Unknown argument:', args[1:] |
426 option_parser.print_usage() | 426 option_parser.print_usage() |
427 sys.exit(1) | 427 sys.exit(1) |
428 run_tests_helper.SetLogLevel(options.verbose_count) | 428 run_tests_helper.SetLogLevel(options.verbose_count) |
| 429 emulator.DeleteAllTempAVDs() |
429 failed_tests_count = Dispatch(options) | 430 failed_tests_count = Dispatch(options) |
430 | 431 |
431 # Failures of individual test suites are communicated by printing a | 432 # Failures of individual test suites are communicated by printing a |
432 # STEP_FAILURE message. | 433 # STEP_FAILURE message. |
433 # Returning a success exit status also prevents the buildbot from incorrectly | 434 # Returning a success exit status also prevents the buildbot from incorrectly |
434 # marking the last suite as failed if there were failures in other suites in | 435 # marking the last suite as failed if there were failures in other suites in |
435 # the batch (this happens because the exit status is a sum of all failures | 436 # the batch (this happens because the exit status is a sum of all failures |
436 # from all suites, but the buildbot associates the exit status only with the | 437 # from all suites, but the buildbot associates the exit status only with the |
437 # most recent step). | 438 # most recent step). |
438 if options.exit_code: | 439 if options.exit_code: |
439 return failed_tests_count | 440 return failed_tests_count |
440 return 0 | 441 return 0 |
441 | 442 |
442 | 443 |
443 if __name__ == '__main__': | 444 if __name__ == '__main__': |
444 sys.exit(main(sys.argv)) | 445 sys.exit(main(sys.argv)) |
OLD | NEW |