| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 log_dump_name: Name of log dump file. | 160 log_dump_name: Name of log dump file. |
| 161 annotate: should we print buildbot-style annotations? | 161 annotate: should we print buildbot-style annotations? |
| 162 | 162 |
| 163 Returns: | 163 Returns: |
| 164 A TestResults object. | 164 A TestResults object. |
| 165 """ | 165 """ |
| 166 results = [] | 166 results = [] |
| 167 | 167 |
| 168 if test_suite: | 168 if test_suite: |
| 169 global _TEST_SUITES | 169 global _TEST_SUITES |
| 170 if (not os.path.exists(test_suite) and | 170 if not os.path.exists(test_suite): |
| 171 not os.path.splitext(test_suite)[1] == '.apk'): | |
| 172 logging.critical('Unrecognized test suite %s, supported: %s' % | 171 logging.critical('Unrecognized test suite %s, supported: %s' % |
| 173 (test_suite, _TEST_SUITES)) | 172 (test_suite, _TEST_SUITES)) |
| 174 if test_suite in _TEST_SUITES: | 173 if test_suite in _TEST_SUITES: |
| 175 logging.critical('(Remember to include the path: out/Release/%s)', | 174 logging.critical('(Remember to include the path: out/Release/%s)', |
| 176 test_suite) | 175 test_suite) |
| 177 return TestResults.FromOkAndFailed([], [BaseTestResult(test_suite, '')]) | 176 return TestResults.FromOkAndFailed([], [BaseTestResult(test_suite, '')]) |
| 178 fully_qualified_test_suites = [test_suite] | 177 fully_qualified_test_suites = [test_suite] |
| 179 else: | 178 else: |
| 180 fully_qualified_test_suites = FullyQualifiedTestSuites() | 179 fully_qualified_test_suites = FullyQualifiedTestSuites() |
| 181 debug_info_list = [] | 180 debug_info_list = [] |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 if len(args) > 1: | 422 if len(args) > 1: |
| 424 print 'Unknown argument:', args[1:] | 423 print 'Unknown argument:', args[1:] |
| 425 option_parser.print_usage() | 424 option_parser.print_usage() |
| 426 sys.exit(1) | 425 sys.exit(1) |
| 427 run_tests_helper.SetLogLevel(options.verbose_count) | 426 run_tests_helper.SetLogLevel(options.verbose_count) |
| 428 return Dispatch(options) | 427 return Dispatch(options) |
| 429 | 428 |
| 430 | 429 |
| 431 if __name__ == '__main__': | 430 if __name__ == '__main__': |
| 432 sys.exit(main(sys.argv)) | 431 sys.exit(main(sys.argv)) |
| OLD | NEW |