16f418080f
There are still some places in the frontend (HTML+Javascript) code where we assume we are handling expectations vs actuals, but there are just a few and we should be able to remove them easily in a coming CL. At that point, the frontend will work just as well for displaying any set of image pairs. BUG=skia:1919 NOTRY=True R=rmistry@google.com Author: epoger@google.com Review URL: https://codereview.chromium.org/178253010 git-svn-id: http://skia.googlecode.com/svn/trunk@13598 2bbb7eff-a529-9590-31e7-b0007b416f81
49 lines
1.3 KiB
Python
Executable File
49 lines
1.3 KiB
Python
Executable File
#!/usr/bin/python
|
|
|
|
"""
|
|
Copyright 2013 Google Inc.
|
|
|
|
Use of this source code is governed by a BSD-style license that can be
|
|
found in the LICENSE file.
|
|
|
|
Test results.py
|
|
|
|
TODO(epoger): Create a command to update the expected results (in
|
|
self._output_dir_expected) when appropriate. For now, you should:
|
|
1. examine the results in self._output_dir_actual and make sure they are ok
|
|
2. rm -rf self._output_dir_expected
|
|
3. mv self._output_dir_actual self._output_dir_expected
|
|
Although, if you're using an SVN checkout, this will blow away .svn directories
|
|
within self._output_dir_expected, which wouldn't be good...
|
|
|
|
"""
|
|
|
|
import os
|
|
import sys
|
|
|
|
# Imports from within Skia
|
|
import base_unittest
|
|
import results
|
|
import gm_json # must import results first, so that gm_json will be in sys.path
|
|
|
|
|
|
class ResultsTest(base_unittest.TestCase):
|
|
|
|
def test_gm(self):
|
|
"""Process results of a GM run with the Results object."""
|
|
results_obj = results.Results(
|
|
actuals_root=os.path.join(self._input_dir, 'gm-actuals'),
|
|
expected_root=os.path.join(self._input_dir, 'gm-expectations'),
|
|
generated_images_root=self._temp_dir)
|
|
gm_json.WriteToFile(
|
|
results_obj.get_results_of_type(results.KEY__HEADER__RESULTS_ALL),
|
|
os.path.join(self._output_dir_actual, 'gm.json'))
|
|
|
|
|
|
def main():
|
|
base_unittest.main(ResultsTest)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|