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.FromOkFailedAndCrashed( |
John Grabowski
2012/05/07 19:22:15
Seems a bit verbose now; how about just TestResult
nilesh
2012/05/08 01:38:10
Done.
| |
197 False, False) | 197 [], [BaseTestResult(test_suite, '')], [], False, False) |
198 fully_qualified_test_suites = [test_suite] | 198 fully_qualified_test_suites = [test_suite] |
199 else: | 199 else: |
200 fully_qualified_test_suites = FullyQualifiedTestSuites(apk) | 200 fully_qualified_test_suites = FullyQualifiedTestSuites(apk) |
201 debug_info_list = [] | 201 debug_info_list = [] |
202 print 'Known suites: ' + str(_TEST_SUITES) | 202 print 'Known suites: ' + str(_TEST_SUITES) |
203 print 'Running these: ' + str(fully_qualified_test_suites) | 203 print 'Running these: ' + str(fully_qualified_test_suites) |
204 for t in fully_qualified_test_suites: | 204 for t in fully_qualified_test_suites: |
205 if annotate: | 205 if annotate: |
206 print '@@@BUILD_STEP Test suite %s@@@' % os.path.basename(t) | 206 print '@@@BUILD_STEP Test suite %s@@@' % os.path.basename(t) |
207 test = SingleTestRunner(device, t, gtest_filter, test_arguments, | 207 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: | 450 if len(args) > 1: |
451 print 'Unknown argument:', args[1:] | 451 print 'Unknown argument:', args[1:] |
452 option_parser.print_usage() | 452 option_parser.print_usage() |
453 sys.exit(1) | 453 sys.exit(1) |
454 run_tests_helper.SetLogLevel(options.verbose_count) | 454 run_tests_helper.SetLogLevel(options.verbose_count) |
455 return Dispatch(options) | 455 return Dispatch(options) |
456 | 456 |
457 | 457 |
458 if __name__ == '__main__': | 458 if __name__ == '__main__': |
459 sys.exit(main(sys.argv)) | 459 sys.exit(main(sys.argv)) |
OLD | NEW |