| 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 """ Run the Skia GM executable. """ | 6 """ Run the Skia GM executable. """ |
| 7 | 7 |
| 8 from build_step import BuildStep | 8 from build_step import BuildStep |
| 9 import build_step | 9 import build_step |
| 10 import os | 10 import os |
| 11 import sys | 11 import sys |
| 12 | 12 |
| 13 | 13 |
| 14 JSON_SUMMARY_FILENAME = 'actual-results.json' | 14 JSON_SUMMARY_FILENAME = 'actual-results.json' |
| 15 | 15 |
| 16 | 16 |
| 17 class RunGM(BuildStep): | 17 class RunGM(BuildStep): |
| 18 def _Run(self): | 18 def _Run(self): |
| 19 device_gm_expectations_path = self.DevicePathJoin( | 19 device_gm_expectations_path = self.DevicePathJoin( |
| 20 self._device_dirs.GMExpectedDir(), build_step.GM_EXPECTATIONS_FILENAME) | 20 self._device_dirs.GMExpectedDir(), build_step.GM_EXPECTATIONS_FILENAME) |
| 21 output_dir = os.path.join(self._device_dirs.GMActualDir(), | 21 output_dir = os.path.join(self._device_dirs.GMActualDir(), |
| 22 self._gm_image_subdir) | 22 self._gm_image_subdir) |
| 23 cmd = ['--verbose', | 23 cmd = ['--verbose', |
| 24 '--writeChecksumBasedFilenames', | 24 '--writeChecksumBasedFilenames', |
| 25 '--writePath', output_dir, | 25 # Don't bother writing out image files that match our expectations-- |
| 26 # we know that previous runs have already uploaded those! |
| 27 '--mismatchPath', output_dir, |
| 28 '--missingExpectationsPath', output_dir, |
| 26 '--writeJsonSummaryPath', os.path.join(output_dir, | 29 '--writeJsonSummaryPath', os.path.join(output_dir, |
| 27 JSON_SUMMARY_FILENAME), | 30 JSON_SUMMARY_FILENAME), |
| 28 '--ignoreErrorTypes', | 31 '--ignoreErrorTypes', |
| 29 'IntentionallySkipped', 'MissingExpectations', | 32 'IntentionallySkipped', 'MissingExpectations', |
| 30 'ExpectationsMismatch', | 33 'ExpectationsMismatch', |
| 31 '--readPath', device_gm_expectations_path, | 34 '--readPath', device_gm_expectations_path, |
| 32 # TODO(borenet): Re-enable --resourcePath when the test passes. | 35 # TODO(borenet): Re-enable --resourcePath when the test passes. |
| 33 #'--resourcePath', self._device_dirs.ResourceDir(), | 36 #'--resourcePath', self._device_dirs.ResourceDir(), |
| 34 ] + self._gm_args | 37 ] + self._gm_args |
| 35 # msaa16 is flaky on Macs (driver bug?) so we skip the test for now | 38 # msaa16 is flaky on Macs (driver bug?) so we skip the test for now |
| 36 if sys.platform == 'darwin': | 39 if sys.platform == 'darwin': |
| 37 cmd.extend(['--config', 'defaults', '~msaa16']) | 40 cmd.extend(['--config', 'defaults', '~msaa16']) |
| 38 elif hasattr(self, '_device') and self._device in ['razr_i', 'nexus_10', | 41 elif hasattr(self, '_device') and self._device in ['razr_i', 'nexus_10', |
| 39 'galaxy_nexus']: | 42 'galaxy_nexus']: |
| 40 cmd.extend(['--config', 'defaults', 'msaa4']) | 43 cmd.extend(['--config', 'defaults', 'msaa4']) |
| 41 elif (not 'NoGPU' in self._builder_name and | 44 elif (not 'NoGPU' in self._builder_name and |
| 42 not 'ChromeOS' in self._builder_name): | 45 not 'ChromeOS' in self._builder_name): |
| 43 cmd.extend(['--config', 'defaults', 'msaa16']) | 46 cmd.extend(['--config', 'defaults', 'msaa16']) |
| 44 self.RunFlavoredCmd('gm', cmd) | 47 self.RunFlavoredCmd('gm', cmd) |
| 45 | 48 |
| 46 | 49 |
| 47 if '__main__' == __name__: | 50 if '__main__' == __name__: |
| 48 sys.exit(BuildStep.RunBuildStep(RunGM)) | 51 sys.exit(BuildStep.RunBuildStep(RunGM)) |
| OLD | NEW |