Chromium Code Reviews| Index: slave/skia_slave_scripts/run_decoding_tests.py |
| diff --git a/slave/skia_slave_scripts/run_decoding_tests.py b/slave/skia_slave_scripts/run_decoding_tests.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..72b4078267ab69994bd614df5ea99da13057f965 |
| --- /dev/null |
| +++ b/slave/skia_slave_scripts/run_decoding_tests.py |
| @@ -0,0 +1,45 @@ |
| +#!/usr/bin/env python |
| +# Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +""" Run the Skia skimage executable. """ |
| + |
| +from build_step import BuildStep |
| +from utils.gs_utils import TIMESTAMP_COMPLETED_FILENAME |
| +import os |
| +import sys |
| + |
| +class RunDecodingTests(BuildStep): |
| + def _Run(self): |
| + image_dir = self._device_dirs.SKImageInDir() |
| + |
| + # Skip the time stamp file. |
| + images = [os.path.join(image_dir, filename) |
| + for filename in os.listdir(image_dir) |
| + if not filename == TIMESTAMP_COMPLETED_FILENAME] |
| + cmd = ['-r'] |
| + cmd.extend(images) |
| + |
| + expectations_name = self._gm_image_subdir + '.json' |
| + |
| + # Read expectations, which were downloaded/copied to the device. |
| + # Note that it is okay for the expectations file to not be there. |
| + expectations_file = os.path.join(self._device_dirs.SKImageExpectedDir(), |
| + expectations_name) |
| + |
| + cmd.extend(['--readExpectationsPath', expectations_file]) |
|
borenet
2013/06/26 12:54:45
I think we should verify that the file exists befo
scroggo
2013/06/26 15:06:39
Done.
|
| + |
| + # Write the expectations file, in case any did not match. |
| + output_expectations_file = os.path.join(self._device_dirs.SKImageOutDir(), |
| + expectations_name) |
| + cmd.extend(['--createExpectationsPath', output_expectations_file]) |
| + |
| + # Draw any mismatches to the same folder as the output json. |
| + cmd.extend(['--mismatchPath', self._device_dirs.SKImageOutDir()]) |
| + |
| + self.RunFlavoredCmd('skimage', cmd) |
| + |
| + |
| +if '__main__' == __name__: |
| + sys.exit(BuildStep.RunBuildStep(RunDecodingTests)) |