Chromium Code Reviews| 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 skimage executable. """ | |
| 7 | |
| 8 from build_step import BuildStep | |
| 9 from utils.gs_utils import TIMESTAMP_COMPLETED_FILENAME | |
| 10 import sys | |
| 11 | |
| 12 class RunDecodingTests(BuildStep): | |
| 13 def _Run(self): | |
| 14 image_dir = self._device_dirs.SKImageInDir() | |
| 15 | |
| 16 # Skip the time stamp file. | |
| 17 images = [self.DevicePathJoin(image_dir, filename) | |
| 18 for filename in self.DeviceListDir(image_dir) | |
|
scroggo
2013/06/26 20:07:09
This CL also adds DeviceListDir.
| |
| 19 if not filename == TIMESTAMP_COMPLETED_FILENAME] | |
| 20 cmd = ['-r'] | |
| 21 cmd.extend(images) | |
| 22 | |
| 23 if self._gm_image_subdir is not None: | |
| 24 expectations_name = self._gm_image_subdir + '.json' | |
| 25 | |
| 26 # Read expectations, which were downloaded/copied to the device. | |
| 27 expectations_file = self.DevicePathJoin( | |
| 28 self._device_dirs.SKImageExpectedDir(), | |
| 29 expectations_name) | |
| 30 | |
| 31 if self.DevicePathExists(expectations_file): | |
| 32 cmd.extend(['--readExpectationsPath', expectations_file]) | |
| 33 | |
| 34 # Write the expectations file, in case any did not match. | |
| 35 output_expectations_file = self.DevicePathJoin( | |
| 36 self._device_dirs.SKImageOutDir(), | |
| 37 expectations_name) | |
| 38 | |
| 39 cmd.extend(['--createExpectationsPath', output_expectations_file]) | |
| 40 | |
| 41 # Draw any mismatches to the same folder as the output json. | |
| 42 cmd.extend(['--mismatchPath', self._device_dirs.SKImageOutDir()]) | |
| 43 | |
| 44 self.RunFlavoredCmd('skimage', cmd) | |
| 45 | |
| 46 | |
| 47 if '__main__' == __name__: | |
| 48 sys.exit(BuildStep.RunBuildStep(RunDecodingTests)) | |
| OLD | NEW |