| OLD | NEW |
| (Empty) |
| 1 #!/usr/bin/env python | |
| 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 | |
| 4 # found in the LICENSE file. | |
| 5 | |
| 6 """ Run the Skia GM executable. """ | |
| 7 | |
| 8 from build_step import BuildStep | |
| 9 import build_step | |
| 10 import sys | |
| 11 | |
| 12 | |
| 13 JSON_SUMMARY_FILENAME = 'actual-results.json' | |
| 14 | |
| 15 | |
| 16 class RunGM(BuildStep): | |
| 17 def __init__(self, timeout=9600, no_output_timeout=9600, **kwargs): | |
| 18 super(RunGM, self).__init__( | |
| 19 timeout=timeout, no_output_timeout=no_output_timeout, **kwargs) | |
| 20 | |
| 21 def _Run(self): | |
| 22 output_dir = self._flavor_utils.DevicePathJoin( | |
| 23 self._device_dirs.GMActualDir(), self._builder_name) | |
| 24 cmd = ['--verbose', | |
| 25 '--writeChecksumBasedFilenames', | |
| 26 # Don't bother writing out image files that match our expectations-- | |
| 27 # we know that previous runs have already uploaded those! | |
| 28 '--mismatchPath', output_dir, | |
| 29 '--missingExpectationsPath', output_dir, | |
| 30 '--writeJsonSummaryPath', self._flavor_utils.DevicePathJoin( | |
| 31 output_dir, JSON_SUMMARY_FILENAME), | |
| 32 '--ignoreErrorTypes', | |
| 33 'IntentionallySkipped', 'MissingExpectations', | |
| 34 'ExpectationsMismatch', | |
| 35 '--resourcePath', self._device_dirs.ResourceDir(), | |
| 36 ] + self._gm_args | |
| 37 | |
| 38 device_gm_expectations_path = self._flavor_utils.DevicePathJoin( | |
| 39 self._device_dirs.GMExpectedDir(), build_step.GM_EXPECTATIONS_FILENAME) | |
| 40 if self._flavor_utils.DevicePathExists(device_gm_expectations_path): | |
| 41 cmd.extend(['--readPath', device_gm_expectations_path]) | |
| 42 | |
| 43 device_ignore_failures_path = self._flavor_utils.DevicePathJoin( | |
| 44 self._device_dirs.GMExpectedDir(), | |
| 45 build_step.GM_IGNORE_FAILURES_FILE) | |
| 46 if self._flavor_utils.DevicePathExists(device_ignore_failures_path): | |
| 47 cmd.extend(['--ignoreFailuresFile', device_ignore_failures_path]) | |
| 48 | |
| 49 if 'Xoom' in self._builder_name: | |
| 50 # The Xoom's GPU will crash on some tests if we don't use this flag. | |
| 51 # http://code.google.com/p/skia/issues/detail?id=1434 | |
| 52 cmd.append('--resetGpuContext') | |
| 53 | |
| 54 if sys.platform == 'darwin': | |
| 55 # msaa16 is flaky on Macs (driver bug?) so we skip the test for now | |
| 56 cmd.extend(['--config', 'defaults', '~msaa16']) | |
| 57 elif 'Nexus10' in self._builder_name: | |
| 58 cmd.extend(['--config', 'defaults', 'msaa4']) | |
| 59 elif 'ANGLE' in self._builder_name: | |
| 60 cmd.extend(['--config', 'angle']) | |
| 61 elif (not 'NoGPU' in self._builder_name and | |
| 62 not 'ChromeOS' in self._builder_name): | |
| 63 cmd.extend(['--config', 'defaults', 'msaa16']) | |
| 64 | |
| 65 if 'Valgrind' in self._builder_name: | |
| 66 # Poppler has lots of memory errors. Skip PDF rasterisation so we don't | |
| 67 # have to see them | |
| 68 # Bug: https://code.google.com/p/skia/issues/detail?id=1806 | |
| 69 cmd.extend(['--pdfRasterizers']) | |
| 70 if 'ZeroGPUCache' in self._builder_name: | |
| 71 cmd.extend(['--gpuCacheSize', '0', '0', '--config', 'gpu']) | |
| 72 if self._builder_name in ('Test-Win7-ShuttleA-HD2000-x86-Release', | |
| 73 'Test-Win7-ShuttleA-HD2000-x86-Release-Trybot'): | |
| 74 cmd.extend(['--useDocumentInsteadOfDevice', | |
| 75 '--forcePerspectiveMatrix', | |
| 76 # Disabling the following tests because they crash GM in | |
| 77 # perspective mode. | |
| 78 # See https://code.google.com/p/skia/issues/detail?id=1665 | |
| 79 '--match', | |
| 80 '~scaled_tilemodes', | |
| 81 '~convexpaths', | |
| 82 '~clipped-bitmap', | |
| 83 '~xfermodes3']) | |
| 84 | |
| 85 if 'Venue8' in self._builder_name: # skia:2922 | |
| 86 cmd.extend(['--match', '~imagealphathreshold']) | |
| 87 | |
| 88 self._flavor_utils.RunFlavoredCmd('gm', cmd) | |
| 89 | |
| 90 | |
| 91 if '__main__' == __name__: | |
| 92 sys.exit(BuildStep.RunBuildStep(RunGM)) | |
| OLD | NEW |