Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 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 import collections | 6 import collections |
| 7 import glob | 7 import glob |
| 8 import hashlib | 8 import hashlib |
| 9 import json | 9 import json |
| 10 import os | 10 import os |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 89 | 89 |
| 90 Returns: | 90 Returns: |
| 91 The revision number. | 91 The revision number. |
| 92 """ | 92 """ |
| 93 revision = options.build_properties.get('got_revision') | 93 revision = options.build_properties.get('got_revision') |
| 94 if not revision: | 94 if not revision: |
| 95 revision = options.build_properties.get('revision', 'testing') | 95 revision = options.build_properties.get('revision', 'testing') |
| 96 return revision | 96 return revision |
| 97 | 97 |
| 98 | 98 |
| 99 def RunTestSuites(options, suites): | 99 def RunTestSuites(options, suites, suites_options=None): |
| 100 """Manages an invocation of test_runner.py for gtests. | 100 """Manages an invocation of test_runner.py for gtests. |
| 101 | 101 |
| 102 Args: | 102 Args: |
| 103 options: options object. | 103 options: options object. |
| 104 suites: List of suite names to run. | 104 suites: List of suite names to run. |
| 105 """ | 105 """ |
| 106 | |
| 107 if not suites_options: | |
| 108 suites_options = {} | |
| 109 | |
| 106 args = ['--verbose'] | 110 args = ['--verbose'] |
| 107 if options.target == 'Release': | 111 if options.target == 'Release': |
| 108 args.append('--release') | 112 args.append('--release') |
| 109 if options.asan: | 113 if options.asan: |
| 110 args.append('--tool=asan') | 114 args.append('--tool=asan') |
| 111 if options.gtest_filter: | 115 if options.gtest_filter: |
| 112 args.append('--gtest-filter=%s' % options.gtest_filter) | 116 args.append('--gtest-filter=%s' % options.gtest_filter) |
| 117 | |
| 113 for suite in suites: | 118 for suite in suites: |
| 114 bb_annotations.PrintNamedStep(suite) | 119 bb_annotations.PrintNamedStep(suite) |
| 115 cmd = ['build/android/test_runner.py', 'gtest', '-s', suite] + args | 120 cmd = ['build/android/test_runner.py', 'gtest', '-s', suite] + args |
| 121 cmd += suites_options.get(suite, ()) | |
|
bulach
2014/05/22 10:30:43
nit: since cmd is a list, maybe for consistency us
Kibeom Kim (inactive)
2014/05/22 17:12:33
Done.
| |
| 116 if suite == 'content_browsertests': | 122 if suite == 'content_browsertests': |
| 117 cmd.append('--num_retries=1') | 123 cmd.append('--num_retries=1') |
| 118 RunCmd(cmd) | 124 RunCmd(cmd) |
| 119 | 125 |
| 120 | 126 |
| 121 def RunChromeDriverTests(options): | 127 def RunChromeDriverTests(options): |
| 122 """Run all the steps for running chromedriver tests.""" | 128 """Run all the steps for running chromedriver tests.""" |
| 123 bb_annotations.PrintNamedStep('chromedriver_annotation') | 129 bb_annotations.PrintNamedStep('chromedriver_annotation') |
| 124 RunCmd(['chrome/test/chromedriver/run_buildbot_steps.py', | 130 RunCmd(['chrome/test/chromedriver/run_buildbot_steps.py', |
| 125 '--android-packages=%s,%s,%s,%s' % | 131 '--android-packages=%s,%s,%s,%s' % |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 651 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) | 657 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) |
| 652 if options.coverage_bucket: | 658 if options.coverage_bucket: |
| 653 setattr(options, 'coverage_dir', | 659 setattr(options, 'coverage_dir', |
| 654 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) | 660 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) |
| 655 | 661 |
| 656 MainTestWrapper(options) | 662 MainTestWrapper(options) |
| 657 | 663 |
| 658 | 664 |
| 659 if __name__ == '__main__': | 665 if __name__ == '__main__': |
| 660 sys.exit(main(sys.argv)) | 666 sys.exit(main(sys.argv)) |
| OLD | NEW |