OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 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 os | 6 import os |
7 import sys | 7 import sys |
8 | 8 |
9 import bb_utils | 9 import bb_utils |
10 import bb_annotations | 10 import bb_annotations |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 bb_annotations.PrintNamedStep('findbugs') | 83 bb_annotations.PrintNamedStep('findbugs') |
84 build_type = [] | 84 build_type = [] |
85 if options.target == 'Release': | 85 if options.target == 'Release': |
86 build_type = ['--release-build'] | 86 build_type = ['--release-build'] |
87 RunCmd([SrcPath('build', 'android', 'findbugs_diff.py')] + build_type) | 87 RunCmd([SrcPath('build', 'android', 'findbugs_diff.py')] + build_type) |
88 RunCmd([SrcPath( | 88 RunCmd([SrcPath( |
89 'tools', 'android', 'findbugs_plugin', 'test', | 89 'tools', 'android', 'findbugs_plugin', 'test', |
90 'run_findbugs_plugin_tests.py')] + build_type) | 90 'run_findbugs_plugin_tests.py')] + build_type) |
91 | 91 |
92 | 92 |
93 def BisectPerfRegression(_): | 93 def BisectPerfRegression(options): |
| 94 args = [] |
| 95 if options.extra_src: |
| 96 args = ['--extra_src', options.extra_src] |
94 RunCmd([SrcPath('tools', 'prepare-bisect-perf-regression.py'), | 97 RunCmd([SrcPath('tools', 'prepare-bisect-perf-regression.py'), |
95 '-w', os.path.join(constants.DIR_SOURCE_ROOT, os.pardir)]) | 98 '-w', os.path.join(constants.DIR_SOURCE_ROOT, os.pardir)]) |
96 RunCmd([SrcPath('tools', 'run-bisect-perf-regression.py'), | 99 RunCmd([SrcPath('tools', 'run-bisect-perf-regression.py'), |
97 '-w', os.path.join(constants.DIR_SOURCE_ROOT, os.pardir)]) | 100 '-w', os.path.join(constants.DIR_SOURCE_ROOT, os.pardir)] + args) |
98 | 101 |
99 | 102 |
100 def GetHostStepCmds(): | 103 def GetHostStepCmds(): |
101 return [ | 104 return [ |
102 ('compile', Compile), | 105 ('compile', Compile), |
103 ('extract_build', ExtractBuild), | 106 ('extract_build', ExtractBuild), |
104 ('check_webview_licenses', CheckWebViewLicenses), | 107 ('check_webview_licenses', CheckWebViewLicenses), |
105 ('bisect_perf_regression', BisectPerfRegression), | 108 ('bisect_perf_regression', BisectPerfRegression), |
106 ('findbugs', FindBugs), | 109 ('findbugs', FindBugs), |
107 ('zip_build', ZipBuild) | 110 ('zip_build', ZipBuild) |
108 ] | 111 ] |
109 | 112 |
110 | 113 |
111 def GetHostStepsOptParser(): | 114 def GetHostStepsOptParser(): |
112 parser = bb_utils.GetParser() | 115 parser = bb_utils.GetParser() |
113 parser.add_option('--steps', help='Comma separated list of host tests.') | 116 parser.add_option('--steps', help='Comma separated list of host tests.') |
114 parser.add_option('--build-targets', default='', | 117 parser.add_option('--build-targets', default='', |
115 help='Comma separated list of build targets.') | 118 help='Comma separated list of build targets.') |
116 parser.add_option('--experimental', action='store_true', | 119 parser.add_option('--experimental', action='store_true', |
117 help='Indicate whether to compile experimental targets.') | 120 help='Indicate whether to compile experimental targets.') |
| 121 parser.add_option('--extra_src', default='', |
| 122 help='Path to extra source file. If this is supplied, ' |
| 123 'bisect script will use it to override default behavior.') |
118 | 124 |
119 return parser | 125 return parser |
120 | 126 |
121 | 127 |
122 def main(argv): | 128 def main(argv): |
123 parser = GetHostStepsOptParser() | 129 parser = GetHostStepsOptParser() |
124 options, args = parser.parse_args(argv[1:]) | 130 options, args = parser.parse_args(argv[1:]) |
125 if args: | 131 if args: |
126 return sys.exit('Unused args %s' % args) | 132 return sys.exit('Unused args %s' % args) |
127 | 133 |
128 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) | 134 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) |
129 | 135 |
130 if options.steps: | 136 if options.steps: |
131 bb_utils.RunSteps(options.steps.split(','), GetHostStepCmds(), options) | 137 bb_utils.RunSteps(options.steps.split(','), GetHostStepCmds(), options) |
132 | 138 |
133 | 139 |
134 if __name__ == '__main__': | 140 if __name__ == '__main__': |
135 sys.exit(main(sys.argv)) | 141 sys.exit(main(sys.argv)) |
OLD | NEW |