OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 ''' | 3 ''' |
4 Copyright 2012 Google Inc. | 4 Copyright 2012 Google Inc. |
5 | 5 |
6 Use of this source code is governed by a BSD-style license that can be | 6 Use of this source code is governed by a BSD-style license that can be |
7 found in the LICENSE file. | 7 found in the LICENSE file. |
8 ''' | 8 ''' |
9 | 9 |
10 ''' | 10 ''' |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
157 infilename = test + '_' + config + '.png' | 157 infilename = test + '_' + config + '.png' |
158 print '# ' + infilename | 158 print '# ' + infilename |
159 outfilename = os.path.join(expectations_subdir, infilename); | 159 outfilename = os.path.join(expectations_subdir, infilename); |
160 self._RebaselineOneFile(expectations_subdir=expectations_subdir, | 160 self._RebaselineOneFile(expectations_subdir=expectations_subdir, |
161 builder_name=builder_name, | 161 builder_name=builder_name, |
162 infilename=infilename, | 162 infilename=infilename, |
163 outfilename=outfilename) | 163 outfilename=outfilename) |
164 | 164 |
165 # Rebaseline all platforms/tests/types we specified in the constructor. | 165 # Rebaseline all platforms/tests/types we specified in the constructor. |
166 def RebaselineAll(self): | 166 def RebaselineAll(self): |
167 for test in self._tests: | 167 for subdir in self._subdirs: |
168 for subdir in self._subdirs: | 168 if not subdir in SUBDIR_MAPPING.keys(): |
169 if not subdir in SUBDIR_MAPPING.keys(): | 169 raise Exception(('unrecognized platform subdir "%s"; ' + |
170 raise Exception(('unrecognized platform subdir "%s"; ' + | 170 'should be one of %s') % ( |
171 'should be one of %s') % ( | 171 subdir, SUBDIR_MAPPING.keys())) |
172 subdir, SUBDIR_MAPPING.keys())) | 172 builder_name = SUBDIR_MAPPING[subdir] |
173 builder_name = SUBDIR_MAPPING[subdir] | 173 for test in self._tests: |
epoger
2013/06/04 16:01:22
Patchset 2 loops over subdirs first, and then in t
| |
174 self._RebaselineOneTest(expectations_subdir=subdir, | 174 self._RebaselineOneTest(expectations_subdir=subdir, |
175 builder_name=builder_name, | 175 builder_name=builder_name, |
176 test=test) | 176 test=test) |
177 | 177 |
178 | 178 |
179 # main... | 179 # main... |
180 | 180 |
181 parser = argparse.ArgumentParser() | 181 parser = argparse.ArgumentParser() |
182 parser.add_argument('--configs', metavar='CONFIG', nargs='+', | 182 parser.add_argument('--configs', metavar='CONFIG', nargs='+', |
183 help='which configurations to rebaseline, e.g. ' + | 183 help='which configurations to rebaseline, e.g. ' + |
184 '"--configs 565 8888"; if unspecified, run a default ' + | 184 '"--configs 565 8888"; if unspecified, run a default ' + |
185 'set of configs') | 185 'set of configs') |
186 parser.add_argument('--dry_run', action='store_true', | 186 parser.add_argument('--dry_run', action='store_true', |
187 help='instead of actually downloading files or adding ' + | 187 help='instead of actually downloading files or adding ' + |
188 'files to checkout, display a list of operations that ' + | 188 'files to checkout, display a list of operations that ' + |
189 'we would normally perform') | 189 'we would normally perform') |
190 parser.add_argument('--json_base_url', | |
191 help='base URL from which to read actual-results.json ' + | |
192 'files; defaults to %(default)s', | |
193 default='http://skia-autogen.googlecode.com/svn/gm-actual') | |
190 parser.add_argument('--subdirs', metavar='SUBDIR', nargs='+', | 194 parser.add_argument('--subdirs', metavar='SUBDIR', nargs='+', |
191 help='which platform subdirectories to rebaseline; ' + | 195 help='which platform subdirectories to rebaseline; ' + |
192 'if unspecified, rebaseline all subdirs, same as ' + | 196 'if unspecified, rebaseline all subdirs, same as ' + |
193 '"--subdirs %s"' % ' '.join(sorted(SUBDIR_MAPPING.keys()))) | 197 '"--subdirs %s"' % ' '.join(sorted(SUBDIR_MAPPING.keys()))) |
194 parser.add_argument('--tests', metavar='TEST', nargs='+', required=True, | 198 parser.add_argument('--tests', metavar='TEST', nargs='+', required=True, |
195 help='which tests to rebaseline, e.g. ' + | 199 help='which tests to rebaseline, e.g. ' + |
196 '"--tests aaclip bigmatrix"') | 200 '"--tests aaclip bigmatrix"; if unspecified, then all ' + |
201 'failing tests (according to the actual-results.json ' + | |
202 'file) will be rebaselined.') | |
197 args = parser.parse_args() | 203 args = parser.parse_args() |
198 rebaseliner = Rebaseliner(tests=args.tests, configs=args.configs, | 204 rebaseliner = Rebaseliner(tests=args.tests, configs=args.configs, |
199 subdirs=args.subdirs, dry_run=args.dry_run) | 205 subdirs=args.subdirs, dry_run=args.dry_run) |
200 rebaseliner.RebaselineAll() | 206 rebaseliner.RebaselineAll() |
OLD | NEW |