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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 args.append('--generate-json-file') | 117 args.append('--generate-json-file') |
118 args += ['-o', 'gtest-results/%s' % suite, | 118 args += ['-o', 'gtest-results/%s' % suite, |
119 '--annotate', 'gtest', | 119 '--annotate', 'gtest', |
120 '--build-number', str(options.build_properties.get('buildnumber', | 120 '--build-number', str(options.build_properties.get('buildnumber', |
121 '')), | 121 '')), |
122 '--builder-name', options.build_properties.get('buildername', '')] | 122 '--builder-name', options.build_properties.get('buildername', '')] |
123 if options.target == 'Release': | 123 if options.target == 'Release': |
124 args += ['--target', 'Release'] | 124 args += ['--target', 'Release'] |
125 else: | 125 else: |
126 args += ['--target', 'Debug'] | 126 args += ['--target', 'Debug'] |
| 127 if options.flakiness_server: |
| 128 args += ['--flakiness-dashboard-server=%s' % |
| 129 options.flakiness_server] |
127 args += cmd | 130 args += cmd |
128 RunCmd(args, cwd=DIR_BUILD_ROOT) | 131 RunCmd(args, cwd=DIR_BUILD_ROOT) |
129 | 132 |
130 | 133 |
131 def RunTestSuites(options, suites, suites_options=None): | 134 def RunTestSuites(options, suites, suites_options=None): |
132 """Manages an invocation of test_runner.py for gtests. | 135 """Manages an invocation of test_runner.py for gtests. |
133 | 136 |
134 Args: | 137 Args: |
135 options: options object. | 138 options: options object. |
136 suites: List of suite names to run. | 139 suites: List of suite names to run. |
137 suites_options: Command line options dictionary for particular suites. | 140 suites_options: Command line options dictionary for particular suites. |
138 For example, | 141 For example, |
139 {'content_browsertests', ['--num_retries=1', '--release']} | 142 {'content_browsertests', ['--num_retries=1', '--release']} |
140 will add the options only to content_browsertests. | 143 will add the options only to content_browsertests. |
141 """ | 144 """ |
142 | 145 |
143 if not suites_options: | 146 if not suites_options: |
144 suites_options = {} | 147 suites_options = {} |
145 | 148 |
146 args = ['--verbose'] | 149 args = ['--verbose'] |
147 if options.target == 'Release': | 150 if options.target == 'Release': |
148 args.append('--release') | 151 args.append('--release') |
149 if options.asan: | 152 if options.asan: |
150 args.append('--tool=asan') | 153 args.append('--tool=asan') |
151 if options.gtest_filter: | 154 if options.gtest_filter: |
152 args.append('--gtest-filter=%s' % options.gtest_filter) | 155 args.append('--gtest-filter=%s' % options.gtest_filter) |
153 if options.flakiness_server: | |
154 args.append('--flakiness-dashboard-server=%s' % | |
155 options.flakiness_server) | |
156 | 156 |
157 for suite in suites: | 157 for suite in suites: |
158 bb_annotations.PrintNamedStep(suite) | 158 bb_annotations.PrintNamedStep(suite) |
159 cmd = [suite] + args | 159 cmd = [suite] + args |
160 cmd += suites_options.get(suite, []) | 160 cmd += suites_options.get(suite, []) |
161 if suite == 'content_browsertests': | 161 if suite == 'content_browsertests': |
162 cmd.append('--num_retries=1') | 162 cmd.append('--num_retries=1') |
163 _RunTest(options, cmd, suite) | 163 _RunTest(options, cmd, suite) |
164 | 164 |
165 | 165 |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 | 723 |
724 if options.coverage_bucket: | 724 if options.coverage_bucket: |
725 setattr(options, 'coverage_dir', | 725 setattr(options, 'coverage_dir', |
726 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) | 726 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) |
727 | 727 |
728 MainTestWrapper(options) | 728 MainTestWrapper(options) |
729 | 729 |
730 | 730 |
731 if __name__ == '__main__': | 731 if __name__ == '__main__': |
732 sys.exit(main(sys.argv)) | 732 sys.exit(main(sys.argv)) |
OLD | NEW |