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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 | 186 |
187 if test_suite: | 187 if test_suite: |
188 global _TEST_SUITES | 188 global _TEST_SUITES |
189 if (not os.path.exists(test_suite) and | 189 if (not os.path.exists(test_suite) and |
190 not os.path.splitext(test_suite)[1] == '.apk'): | 190 not os.path.splitext(test_suite)[1] == '.apk'): |
191 logging.critical('Unrecognized test suite %s, supported: %s' % | 191 logging.critical('Unrecognized test suite %s, supported: %s' % |
192 (test_suite, _TEST_SUITES)) | 192 (test_suite, _TEST_SUITES)) |
193 if test_suite in _TEST_SUITES: | 193 if test_suite in _TEST_SUITES: |
194 logging.critical('(Remember to include the path: out/Release/%s)', | 194 logging.critical('(Remember to include the path: out/Release/%s)', |
195 test_suite) | 195 test_suite) |
196 return TestResults.FromOkAndFailed([], [BaseTestResult(test_suite, '')], | 196 return TestResults.FromRun(failed=[BaseTestResult(test_suite, '')]) |
197 False, False) | |
198 fully_qualified_test_suites = [test_suite] | 197 fully_qualified_test_suites = [test_suite] |
199 else: | 198 else: |
200 fully_qualified_test_suites = FullyQualifiedTestSuites(apk) | 199 fully_qualified_test_suites = FullyQualifiedTestSuites(apk) |
201 debug_info_list = [] | 200 debug_info_list = [] |
202 print 'Known suites: ' + str(_TEST_SUITES) | 201 print 'Known suites: ' + str(_TEST_SUITES) |
203 print 'Running these: ' + str(fully_qualified_test_suites) | 202 print 'Running these: ' + str(fully_qualified_test_suites) |
204 for t in fully_qualified_test_suites: | 203 for t in fully_qualified_test_suites: |
205 if annotate: | 204 if annotate: |
206 print '@@@BUILD_STEP Test suite %s@@@' % os.path.basename(t) | 205 print '@@@BUILD_STEP Test suite %s@@@' % os.path.basename(t) |
207 test = SingleTestRunner(device, t, gtest_filter, test_arguments, | 206 test = SingleTestRunner(device, t, gtest_filter, test_arguments, |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 if len(args) > 1: | 449 if len(args) > 1: |
451 print 'Unknown argument:', args[1:] | 450 print 'Unknown argument:', args[1:] |
452 option_parser.print_usage() | 451 option_parser.print_usage() |
453 sys.exit(1) | 452 sys.exit(1) |
454 run_tests_helper.SetLogLevel(options.verbose_count) | 453 run_tests_helper.SetLogLevel(options.verbose_count) |
455 return Dispatch(options) | 454 return Dispatch(options) |
456 | 455 |
457 | 456 |
458 if __name__ == '__main__': | 457 if __name__ == '__main__': |
459 sys.exit(main(sys.argv)) | 458 sys.exit(main(sys.argv)) |
OLD | NEW |