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..fd5a8458943fdbef9f10a8141baa9ae8f8694d6a |
--- /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' |
borenet
2013/06/26 17:37:54
I think the better way is to check whether self._g
scroggo
2013/06/26 18:30:15
Done.
|
+ |
+ # Read expectations, which were downloaded/copied to the device. |
+ expectations_file = os.path.join(self._device_dirs.SKImageExpectedDir(), |
+ expectations_name) |
+ |
+ if os.path.exists(expectations_file): |
borenet
2013/06/26 17:37:54
This won't work for Android or ChromeOS.
scroggo
2013/06/26 18:30:15
Added DevicePathExists.
I also switched from os.p
|
+ cmd.extend(['--readExpectationsPath', expectations_file]) |
+ |
+ # 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)) |