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 os |
| 11 import sys |
| 12 |
| 13 class RunDecodingTests(BuildStep): |
| 14 def _Run(self): |
| 15 image_dir = self._device_dirs.SKImageInDir() |
| 16 |
| 17 # Skip the time stamp file. |
| 18 images = [os.path.join(image_dir, filename) |
| 19 for filename in os.listdir(image_dir) |
| 20 if not filename == TIMESTAMP_COMPLETED_FILENAME] |
| 21 cmd = ['-r'] |
| 22 cmd.extend(images) |
| 23 |
| 24 expectations_name = self._gm_image_subdir + '.json' |
| 25 |
| 26 # Read expectations, which were downloaded/copied to the device. |
| 27 expectations_file = os.path.join(self._device_dirs.SKImageExpectedDir(), |
| 28 expectations_name) |
| 29 |
| 30 if os.path.exists(expectations_file): |
| 31 cmd.extend(['--readExpectationsPath', expectations_file]) |
| 32 |
| 33 # Write the expectations file, in case any did not match. |
| 34 output_expectations_file = os.path.join(self._device_dirs.SKImageOutDir(), |
| 35 expectations_name) |
| 36 cmd.extend(['--createExpectationsPath', output_expectations_file]) |
| 37 |
| 38 # Draw any mismatches to the same folder as the output json. |
| 39 cmd.extend(['--mismatchPath', self._device_dirs.SKImageOutDir()]) |
| 40 |
| 41 self.RunFlavoredCmd('skimage', cmd) |
| 42 |
| 43 |
| 44 if '__main__' == __name__: |
| 45 sys.exit(BuildStep.RunBuildStep(RunDecodingTests)) |
OLD | NEW |