| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 ReadOnlyFileUtilTest.ContentsEqual | 44 ReadOnlyFileUtilTest.ContentsEqual |
| 45 | 45 |
| 46 This file is generated by the tests running on devices. If running on emulator, | 46 This file is generated by the tests running on devices. If running on emulator, |
| 47 additonal filter file which lists the tests only failed in emulator will be | 47 additonal filter file which lists the tests only failed in emulator will be |
| 48 loaded. We don't care about the rare testcases which succeeded on emuatlor, but | 48 loaded. We don't care about the rare testcases which succeeded on emuatlor, but |
| 49 failed on device. | 49 failed on device. |
| 50 """ | 50 """ |
| 51 | 51 |
| 52 import fnmatch | 52 import fnmatch |
| 53 import logging | 53 import logging |
| 54 import optparse |
| 54 import os | 55 import os |
| 55 import signal | 56 import signal |
| 56 import subprocess | 57 import subprocess |
| 57 import sys | 58 import sys |
| 58 import time | 59 import time |
| 59 | 60 |
| 60 from pylib import android_commands | 61 from pylib import android_commands |
| 61 from pylib.base_test_sharder import BaseTestSharder | 62 from pylib.base_test_sharder import BaseTestSharder |
| 62 from pylib import buildbot_report | 63 from pylib import buildbot_report |
| 63 from pylib import constants | 64 from pylib import constants |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 | 369 |
| 369 | 370 |
| 370 def ListTestSuites(): | 371 def ListTestSuites(): |
| 371 """Display a list of available test suites.""" | 372 """Display a list of available test suites.""" |
| 372 print 'Available test suites are:' | 373 print 'Available test suites are:' |
| 373 for test_suite in _TEST_SUITES: | 374 for test_suite in _TEST_SUITES: |
| 374 print test_suite | 375 print test_suite |
| 375 | 376 |
| 376 | 377 |
| 377 def main(argv): | 378 def main(argv): |
| 378 option_parser = test_options_parser.CreateTestRunnerOptionParser( | 379 option_parser = optparse.OptionParser() |
| 379 None, default_timeout=0) | 380 test_options_parser.AddTestRunnerOptions(option_parser, default_timeout=0) |
| 380 option_parser.add_option('-s', '--suite', dest='test_suite', | 381 option_parser.add_option('-s', '--suite', dest='test_suite', |
| 381 help='Executable name of the test suite to run ' | 382 help='Executable name of the test suite to run ' |
| 382 '(use -s help to list them)') | 383 '(use -s help to list them)') |
| 383 option_parser.add_option('-d', '--device', dest='test_device', | 384 option_parser.add_option('-d', '--device', dest='test_device', |
| 384 help='Target device the test suite to run ') | 385 help='Target device the test suite to run ') |
| 385 option_parser.add_option('-r', dest='rebaseline', | 386 option_parser.add_option('-r', dest='rebaseline', |
| 386 help='Rebaseline and update *testsuite_disabled', | 387 help='Rebaseline and update *testsuite_disabled', |
| 387 action='store_true') | 388 action='store_true') |
| 388 option_parser.add_option('-f', '--gtest_filter', dest='gtest_filter', | 389 option_parser.add_option('-f', '--gtest_filter', dest='gtest_filter', |
| 389 help='gtest filter') | 390 help='gtest filter') |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 # the batch (this happens because the exit status is a sum of all failures | 441 # the batch (this happens because the exit status is a sum of all failures |
| 441 # from all suites, but the buildbot associates the exit status only with the | 442 # from all suites, but the buildbot associates the exit status only with the |
| 442 # most recent step). | 443 # most recent step). |
| 443 if options.exit_code: | 444 if options.exit_code: |
| 444 return failed_tests_count | 445 return failed_tests_count |
| 445 return 0 | 446 return 0 |
| 446 | 447 |
| 447 | 448 |
| 448 if __name__ == '__main__': | 449 if __name__ == '__main__': |
| 449 sys.exit(main(sys.argv)) | 450 sys.exit(main(sys.argv)) |
| OLD | NEW |