| 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 test = SingleTestRunner(device, t, gtest_filter, test_arguments, | 207 test = SingleTestRunner(device, t, gtest_filter, test_arguments, |
| 208 timeout, rebaseline, performance_test, | 208 timeout, rebaseline, performance_test, |
| 209 cleanup_test_files, tool, 0, not not log_dump_name) | 209 cleanup_test_files, tool, 0, not not log_dump_name) |
| 210 test.Run() | 210 test.Run() |
| 211 | 211 |
| 212 results += [test.test_results] | 212 results += [test.test_results] |
| 213 # Collect debug info. | 213 # Collect debug info. |
| 214 debug_info_list += [test.dump_debug_info] | 214 debug_info_list += [test.dump_debug_info] |
| 215 if rebaseline: | 215 if rebaseline: |
| 216 test.UpdateFilter(test.test_results.failed) | 216 test.UpdateFilter(test.test_results.failed) |
| 217 elif test.test_results.failed: | 217 test.test_results.LogFull() |
| 218 test.test_results.LogFull() | |
| 219 # Zip all debug info outputs into a file named by log_dump_name. | 218 # Zip all debug info outputs into a file named by log_dump_name. |
| 220 debug_info.GTestDebugInfo.ZipAndCleanResults( | 219 debug_info.GTestDebugInfo.ZipAndCleanResults( |
| 221 os.path.join(run_tests_helper.CHROME_DIR, 'out', 'Release', | 220 os.path.join(run_tests_helper.CHROME_DIR, 'out', 'Release', |
| 222 'debug_info_dumps'), | 221 'debug_info_dumps'), |
| 223 log_dump_name, [d for d in debug_info_list if d]) | 222 log_dump_name, [d for d in debug_info_list if d]) |
| 224 | 223 |
| 225 if annotate: | 224 if annotate: |
| 226 if test.test_results.timed_out: | 225 if test.test_results.timed_out: |
| 227 print '@@@STEP_WARNINGS@@@' | 226 print '@@@STEP_WARNINGS@@@' |
| 228 elif test.test_results.failed: | 227 elif test.test_results.failed: |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 if len(args) > 1: | 450 if len(args) > 1: |
| 452 print 'Unknown argument:', args[1:] | 451 print 'Unknown argument:', args[1:] |
| 453 option_parser.print_usage() | 452 option_parser.print_usage() |
| 454 sys.exit(1) | 453 sys.exit(1) |
| 455 run_tests_helper.SetLogLevel(options.verbose_count) | 454 run_tests_helper.SetLogLevel(options.verbose_count) |
| 456 return Dispatch(options) | 455 return Dispatch(options) |
| 457 | 456 |
| 458 | 457 |
| 459 if __name__ == '__main__': | 458 if __name__ == '__main__': |
| 460 sys.exit(main(sys.argv)) | 459 sys.exit(main(sys.argv)) |
| OLD | NEW |