OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Runs all the native unit tests. | 6 """Runs all the native unit tests. |
7 | 7 |
8 1. Copy over test binary to /data/local on device. | 8 1. Copy over test binary to /data/local on device. |
9 2. Resources: chrome/unit_tests requires resources (chrome.pak and en-US.pak) | 9 2. Resources: chrome/unit_tests requires resources (chrome.pak and en-US.pak) |
10 to be deployed to the device (in /data/local/tmp). | 10 to be deployed to the device (in /data/local/tmp). |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 'tests that hang to add to the disabled list, ' | 446 'tests that hang to add to the disabled list, ' |
447 'there is no need to redeploy the test binary ' | 447 'there is no need to redeploy the test binary ' |
448 'or data to the device again. ' | 448 'or data to the device again. ' |
449 'Don\'t use on bots by default!') | 449 'Don\'t use on bots by default!') |
450 option_parser.add_option('--repeat', dest='repeat', type='int', | 450 option_parser.add_option('--repeat', dest='repeat', type='int', |
451 default=2, | 451 default=2, |
452 help='Repeat count on test timeout') | 452 help='Repeat count on test timeout') |
453 option_parser.add_option('--annotate', default=True, | 453 option_parser.add_option('--annotate', default=True, |
454 help='Print buildbot-style annotate messages ' | 454 help='Print buildbot-style annotate messages ' |
455 'for each test suite. Default=True') | 455 'for each test suite. Default=True') |
456 option_parser.add_option('--apk', default=False, | 456 option_parser.add_option('--apk', default=True, |
457 help='Use the apk test runner ' | 457 help='Use the apk test runner by default') |
458 '(off by default for now)') | |
459 options, args = option_parser.parse_args(argv) | 458 options, args = option_parser.parse_args(argv) |
460 if len(args) > 1: | 459 if len(args) > 1: |
461 print 'Unknown argument:', args[1:] | 460 print 'Unknown argument:', args[1:] |
462 option_parser.print_usage() | 461 option_parser.print_usage() |
463 sys.exit(1) | 462 sys.exit(1) |
464 run_tests_helper.SetLogLevel(options.verbose_count) | 463 run_tests_helper.SetLogLevel(options.verbose_count) |
465 failed_tests_count = Dispatch(options) | 464 failed_tests_count = Dispatch(options) |
466 | 465 |
467 # If we're printing annotations then failures of individual test suites are | 466 # If we're printing annotations then failures of individual test suites are |
468 # communicated by printing a STEP_FAILURE message. | 467 # communicated by printing a STEP_FAILURE message. |
469 # Returning a success exit status also prevents the buildbot from incorrectly | 468 # Returning a success exit status also prevents the buildbot from incorrectly |
470 # marking the last suite as failed if there were failures in other suites in | 469 # marking the last suite as failed if there were failures in other suites in |
471 # the batch (this happens because the exit status is a sum of all failures | 470 # the batch (this happens because the exit status is a sum of all failures |
472 # from all suites, but the buildbot associates the exit status only with the | 471 # from all suites, but the buildbot associates the exit status only with the |
473 # most recent step). | 472 # most recent step). |
474 if options.annotate: | 473 if options.annotate: |
475 return 0 | 474 return 0 |
476 else: | 475 else: |
477 return failed_tests_count | 476 return failed_tests_count |
478 | 477 |
479 | 478 |
480 if __name__ == '__main__': | 479 if __name__ == '__main__': |
481 sys.exit(main(sys.argv)) | 480 sys.exit(main(sys.argv)) |
OLD | NEW |