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 OVERRIDE_IGNORED_TESTS_FILE = 'ignored-tests.txt' | |
epoger
2013/09/19 16:12:59
Creation of this file is in a separate CL:
https:/
| |
15 | 16 |
16 | 17 |
17 class RunGM(BuildStep): | 18 class RunGM(BuildStep): |
19 def _GetAdditionalTestsToIgnore(self): | |
20 """Parse the OVERRIDE_IGNORED_TESTS_FILE, and return any tests listed there | |
21 as an list. If the file is empty or nonexistent, return an empty list. | |
22 | |
23 See https://code.google.com/p/skia/issues/detail?id=1600#c4 | |
24 """ | |
25 tests = [] | |
26 override_ignored_tests_path = os.path.join( | |
27 self._gm_expected_dir, os.pardir, OVERRIDE_IGNORED_TESTS_FILE) | |
28 try: | |
29 with open(override_ignored_tests_path) as f: | |
30 for line in f.readlines(): | |
31 line = line.strip() | |
32 if not line: | |
33 continue | |
34 if line.startswith('#'): | |
35 continue | |
36 tests.append(line) | |
37 except IOError: | |
38 print ('override_ignored_tests_path %s does not exist' % | |
39 override_ignored_tests_path) | |
40 return [] | |
41 print ('Found these tests to ignore at override_ignored_tests_path %s: %s' % | |
42 (override_ignored_tests_path, tests)) | |
43 return tests | |
44 | |
18 def _Run(self): | 45 def _Run(self): |
19 device_gm_expectations_path = self._flavor_utils.DevicePathJoin( | 46 device_gm_expectations_path = self._flavor_utils.DevicePathJoin( |
20 self._device_dirs.GMExpectedDir(), build_step.GM_EXPECTATIONS_FILENAME) | 47 self._device_dirs.GMExpectedDir(), build_step.GM_EXPECTATIONS_FILENAME) |
21 output_dir = os.path.join(self._device_dirs.GMActualDir(), | 48 output_dir = os.path.join(self._device_dirs.GMActualDir(), |
22 self._builder_name) | 49 self._builder_name) |
23 cmd = ['--verbose', | 50 cmd = ['--verbose', |
24 '--writeChecksumBasedFilenames', | 51 '--writeChecksumBasedFilenames', |
25 # Don't bother writing out image files that match our expectations-- | 52 # Don't bother writing out image files that match our expectations-- |
26 # we know that previous runs have already uploaded those! | 53 # we know that previous runs have already uploaded those! |
27 '--mismatchPath', output_dir, | 54 '--mismatchPath', output_dir, |
28 '--missingExpectationsPath', output_dir, | 55 '--missingExpectationsPath', output_dir, |
29 '--writeJsonSummaryPath', os.path.join(output_dir, | 56 '--writeJsonSummaryPath', os.path.join(output_dir, |
30 JSON_SUMMARY_FILENAME), | 57 JSON_SUMMARY_FILENAME), |
31 '--ignoreErrorTypes', | 58 '--ignoreErrorTypes', |
32 'IntentionallySkipped', 'MissingExpectations', | 59 'IntentionallySkipped', 'MissingExpectations', |
33 'ExpectationsMismatch', | 60 'ExpectationsMismatch', |
34 '--readPath', device_gm_expectations_path, | 61 '--readPath', device_gm_expectations_path, |
35 '--resourcePath', self._device_dirs.ResourceDir(), | 62 '--resourcePath', self._device_dirs.ResourceDir(), |
36 ] + self._gm_args | 63 ] + self._gm_args |
64 | |
65 additional_tests_to_ignore = self._GetAdditionalTestsToIgnore() | |
66 if additional_tests_to_ignore: | |
67 cmd.extend(['--ignoreTests'] + additional_tests_to_ignore) | |
68 | |
37 # msaa16 is flaky on Macs (driver bug?) so we skip the test for now | 69 # msaa16 is flaky on Macs (driver bug?) so we skip the test for now |
38 if sys.platform == 'darwin': | 70 if sys.platform == 'darwin': |
39 cmd.extend(['--config', 'defaults', '~msaa16']) | 71 cmd.extend(['--config', 'defaults', '~msaa16']) |
40 elif ('RazrI' in self._builder_name or | 72 elif ('RazrI' in self._builder_name or |
41 'Nexus10' in self._builder_name or | 73 'Nexus10' in self._builder_name or |
42 'GalaxyNexus' in self._builder_name or | 74 'GalaxyNexus' in self._builder_name or |
43 'Nexus4' in self._builder_name): | 75 'Nexus4' in self._builder_name): |
44 cmd.extend(['--config', 'defaults', 'msaa4']) | 76 cmd.extend(['--config', 'defaults', 'msaa4']) |
45 elif (not 'NoGPU' in self._builder_name and | 77 elif (not 'NoGPU' in self._builder_name and |
46 not 'ChromeOS' in self._builder_name): | 78 not 'ChromeOS' in self._builder_name): |
47 cmd.extend(['--config', 'defaults', 'msaa16']) | 79 cmd.extend(['--config', 'defaults', 'msaa16']) |
48 self._flavor_utils.RunFlavoredCmd('gm', cmd) | 80 self._flavor_utils.RunFlavoredCmd('gm', cmd) |
49 | 81 |
50 | 82 |
51 if '__main__' == __name__: | 83 if '__main__' == __name__: |
52 sys.exit(BuildStep.RunBuildStep(RunGM)) | 84 sys.exit(BuildStep.RunBuildStep(RunGM)) |
OLD | NEW |