OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 """ | 3 """ |
4 Copyright 2013 Google Inc. | 4 Copyright 2013 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 Repackage expected/actual GM results as needed by our HTML rebaseline viewer. | 9 Repackage expected/actual GM results as needed by our HTML rebaseline viewer. |
10 """ | 10 """ |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 results.KEY__EXTRACOLUMN__BUILDER: 'Test-Mac10.6-MacMini4.1-GeFor
ce320M-x86-Debug', | 114 results.KEY__EXTRACOLUMN__BUILDER: 'Test-Mac10.6-MacMini4.1-GeFor
ce320M-x86-Debug', |
115 results.KEY__EXTRACOLUMN__CONFIG: '8888', | 115 results.KEY__EXTRACOLUMN__CONFIG: '8888', |
116 results.KEY__EXTRACOLUMN__TEST: 'bigmatrix', | 116 results.KEY__EXTRACOLUMN__TEST: 'bigmatrix', |
117 }, | 117 }, |
118 results.KEY__NEW_IMAGE_URL: 'bitmap-64bitMD5/bigmatrix/108944080240
79689926.png', | 118 results.KEY__NEW_IMAGE_URL: 'bitmap-64bitMD5/bigmatrix/108944080240
79689926.png', |
119 }, | 119 }, |
120 ... | 120 ... |
121 ] | 121 ] |
122 | 122 |
123 """ | 123 """ |
124 expected_builder_dicts = self._read_dicts_from_root(self._expected_root) | 124 expected_builder_dicts = self._read_builder_dicts_from_root( |
| 125 self._expected_root) |
125 for mod in modifications: | 126 for mod in modifications: |
126 image_name = results.IMAGE_FILENAME_FORMATTER % ( | 127 image_name = results.IMAGE_FILENAME_FORMATTER % ( |
127 mod[imagepair.KEY__EXTRA_COLUMN_VALUES] | 128 mod[imagepair.KEY__EXTRA_COLUMN_VALUES] |
128 [results.KEY__EXTRACOLUMN__TEST], | 129 [results.KEY__EXTRACOLUMN__TEST], |
129 mod[imagepair.KEY__EXTRA_COLUMN_VALUES] | 130 mod[imagepair.KEY__EXTRA_COLUMN_VALUES] |
130 [results.KEY__EXTRACOLUMN__CONFIG]) | 131 [results.KEY__EXTRACOLUMN__CONFIG]) |
131 _, hash_type, hash_digest = gm_json.SplitGmRelativeUrl( | 132 _, hash_type, hash_digest = gm_json.SplitGmRelativeUrl( |
132 mod[results.KEY__NEW_IMAGE_URL]) | 133 mod[results.KEY__NEW_IMAGE_URL]) |
133 allowed_digests = [[hash_type, int(hash_digest)]] | 134 allowed_digests = [[hash_type, int(hash_digest)]] |
134 new_expectations = { | 135 new_expectations = { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 'for builders %s' % ( | 194 'for builders %s' % ( |
194 expected_builders_written, actual_builders_written)) | 195 expected_builders_written, actual_builders_written)) |
195 | 196 |
196 def _load_actual_and_expected(self): | 197 def _load_actual_and_expected(self): |
197 """Loads the results of all tests, across all builders (based on the | 198 """Loads the results of all tests, across all builders (based on the |
198 files within self._actuals_root and self._expected_root), | 199 files within self._actuals_root and self._expected_root), |
199 and stores them in self._results. | 200 and stores them in self._results. |
200 """ | 201 """ |
201 logging.info('Reading actual-results JSON files from %s...' % | 202 logging.info('Reading actual-results JSON files from %s...' % |
202 self._actuals_root) | 203 self._actuals_root) |
203 actual_builder_dicts = self._read_dicts_from_root(self._actuals_root) | 204 actual_builder_dicts = self._read_builder_dicts_from_root( |
| 205 self._actuals_root) |
204 logging.info('Reading expected-results JSON files from %s...' % | 206 logging.info('Reading expected-results JSON files from %s...' % |
205 self._expected_root) | 207 self._expected_root) |
206 expected_builder_dicts = self._read_dicts_from_root(self._expected_root) | 208 expected_builder_dicts = self._read_builder_dicts_from_root( |
| 209 self._expected_root) |
207 | 210 |
208 all_image_pairs = imagepairset.ImagePairSet( | 211 all_image_pairs = imagepairset.ImagePairSet( |
209 descriptions=IMAGEPAIR_SET_DESCRIPTIONS, | 212 descriptions=IMAGEPAIR_SET_DESCRIPTIONS, |
210 diff_base_url=self._diff_base_url) | 213 diff_base_url=self._diff_base_url) |
211 failing_image_pairs = imagepairset.ImagePairSet( | 214 failing_image_pairs = imagepairset.ImagePairSet( |
212 descriptions=IMAGEPAIR_SET_DESCRIPTIONS, | 215 descriptions=IMAGEPAIR_SET_DESCRIPTIONS, |
213 diff_base_url=self._diff_base_url) | 216 diff_base_url=self._diff_base_url) |
214 | 217 |
215 all_image_pairs.ensure_extra_column_values_in_summary( | 218 all_image_pairs.ensure_extra_column_values_in_summary( |
216 column_id=results.KEY__EXTRACOLUMN__RESULT_TYPE, values=[ | 219 column_id=results.KEY__EXTRACOLUMN__RESULT_TYPE, values=[ |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 results_obj = ExpectationComparisons(actuals_root=args.actuals, | 376 results_obj = ExpectationComparisons(actuals_root=args.actuals, |
374 expected_root=args.expectations, | 377 expected_root=args.expectations, |
375 generated_images_root=args.workdir) | 378 generated_images_root=args.workdir) |
376 gm_json.WriteToFile( | 379 gm_json.WriteToFile( |
377 results_obj.get_packaged_results_of_type(results_type=args.results), | 380 results_obj.get_packaged_results_of_type(results_type=args.results), |
378 args.outfile) | 381 args.outfile) |
379 | 382 |
380 | 383 |
381 if __name__ == '__main__': | 384 if __name__ == '__main__': |
382 main() | 385 main() |
OLD | NEW |