Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(476)

Side by Side Diff: gm/rebaseline_server/compare_to_expectations_test.py

Issue 208243003: rebaseline_server: rename results.py to compare_to_expectations.py (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gm/rebaseline_server/compare_to_expectations.py ('k') | gm/rebaseline_server/results.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 """ 3 """
4 Copyright 2013 Google Inc. 4 Copyright 2013 Google Inc.
5 5
6 Use of this source code is governed by a BSD-style license that can be 6 Use of this source code is governed by a BSD-style license that can be
7 found in the LICENSE file. 7 found in the LICENSE file.
8 8
9 Test results.py 9 Test compare_to_expectations.py
10 10
11 TODO(epoger): Create a command to update the expected results (in 11 TODO(epoger): Create a command to update the expected results (in
12 self._output_dir_expected) when appropriate. For now, you should: 12 self._output_dir_expected) when appropriate. For now, you should:
13 1. examine the results in self._output_dir_actual and make sure they are ok 13 1. examine the results in self._output_dir_actual and make sure they are ok
14 2. rm -rf self._output_dir_expected 14 2. rm -rf self._output_dir_expected
15 3. mv self._output_dir_actual self._output_dir_expected 15 3. mv self._output_dir_actual self._output_dir_expected
16 Although, if you're using an SVN checkout, this will blow away .svn directories 16 Although, if you're using an SVN checkout, this will blow away .svn directories
17 within self._output_dir_expected, which wouldn't be good... 17 within self._output_dir_expected, which wouldn't be good...
18 18
19 """ 19 """
20 20
21 import os 21 import os
22 import sys 22 import sys
23 23
24 # Imports from within Skia 24 # Imports from within Skia
25 import base_unittest 25 import base_unittest
26 import compare_to_expectations
26 import results 27 import results
27 import gm_json # must import results first, so that gm_json will be in sys.path 28 import gm_json # must import results first, so that gm_json will be in sys.path
28 29
29 30
30 class ResultsTest(base_unittest.TestCase): 31 class CompareToExpectationsTest(base_unittest.TestCase):
31 32
32 def test_gm(self): 33 def test_gm(self):
33 """Process results of a GM run with the Results object.""" 34 """Process results of a GM run with the Results object."""
34 results_obj = results.Results( 35 results_obj = compare_to_expectations.Results(
35 actuals_root=os.path.join(self._input_dir, 'gm-actuals'), 36 actuals_root=os.path.join(self._input_dir, 'gm-actuals'),
36 expected_root=os.path.join(self._input_dir, 'gm-expectations'), 37 expected_root=os.path.join(self._input_dir, 'gm-expectations'),
37 generated_images_root=self._temp_dir, 38 generated_images_root=self._temp_dir,
38 diff_base_url='/static/generated-images') 39 diff_base_url='/static/generated-images')
39 results_obj.get_timestamp = mock_get_timestamp 40 results_obj.get_timestamp = mock_get_timestamp
40 gm_json.WriteToFile( 41 gm_json.WriteToFile(
41 results_obj.get_packaged_results_of_type( 42 results_obj.get_packaged_results_of_type(
42 results.KEY__HEADER__RESULTS_ALL), 43 results.KEY__HEADER__RESULTS_ALL),
43 os.path.join(self._output_dir_actual, 'gm.json')) 44 os.path.join(self._output_dir_actual, 'gm.json'))
44 45
45 46
46 def mock_get_timestamp(): 47 def mock_get_timestamp():
47 """Mock version of Results.get_timestamp() for testing.""" 48 """Mock version of Results.get_timestamp() for testing."""
48 return 12345678 49 return 12345678
49 50
50 51
51 def main(): 52 def main():
52 base_unittest.main(ResultsTest) 53 base_unittest.main(CompareToExpectationsTest)
53 54
54 55
55 if __name__ == '__main__': 56 if __name__ == '__main__':
56 main() 57 main()
OLDNEW
« no previous file with comments | « gm/rebaseline_server/compare_to_expectations.py ('k') | gm/rebaseline_server/results.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698