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

Side by Side Diff: Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py

Issue 109763007: Reland r159735 - support for test harness (text-only) tests w/o expected results. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: update testharness-based baselines Created 7 years 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 | Annotate | Revision Log
OLDNEW
1 # Copyright (C) 2011 Google Inc. All rights reserved. 1 # Copyright (C) 2011 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 30 matching lines...) Expand all
41 root_output_dir = results_directory 41 root_output_dir = results_directory
42 writer = TestResultWriter(filesystem, port, root_output_dir, test_name) 42 writer = TestResultWriter(filesystem, port, root_output_dir, test_name)
43 43
44 if driver_output.error: 44 if driver_output.error:
45 writer.write_stderr(driver_output.error) 45 writer.write_stderr(driver_output.error)
46 46
47 for failure in failures: 47 for failure in failures:
48 # FIXME: Instead of this long 'if' block, each failure class might 48 # FIXME: Instead of this long 'if' block, each failure class might
49 # have a responsibility for writing a test result. 49 # have a responsibility for writing a test result.
50 if isinstance(failure, (test_failures.FailureMissingResult, 50 if isinstance(failure, (test_failures.FailureMissingResult,
51 test_failures.FailureTextMismatch)): 51 test_failures.FailureTextMismatch,
52 test_failures.FailureTestHarnessAssertion)):
52 writer.write_text_files(driver_output.text, expected_driver_output.t ext) 53 writer.write_text_files(driver_output.text, expected_driver_output.t ext)
53 writer.create_text_diff_and_write_result(driver_output.text, expecte d_driver_output.text) 54 writer.create_text_diff_and_write_result(driver_output.text, expecte d_driver_output.text)
54 elif isinstance(failure, test_failures.FailureMissingImage): 55 elif isinstance(failure, test_failures.FailureMissingImage):
55 writer.write_image_files(driver_output.image, expected_image=None) 56 writer.write_image_files(driver_output.image, expected_image=None)
56 elif isinstance(failure, test_failures.FailureMissingImageHash): 57 elif isinstance(failure, test_failures.FailureMissingImageHash):
57 writer.write_image_files(driver_output.image, expected_driver_output .image) 58 writer.write_image_files(driver_output.image, expected_driver_output .image)
58 elif isinstance(failure, test_failures.FailureImageHashMismatch): 59 elif isinstance(failure, test_failures.FailureImageHashMismatch):
59 writer.write_image_files(driver_output.image, expected_driver_output .image) 60 writer.write_image_files(driver_output.image, expected_driver_output .image)
60 writer.write_image_diff_files(driver_output.image_diff) 61 writer.write_image_diff_files(driver_output.image_diff)
61 elif isinstance(failure, (test_failures.FailureAudioMismatch, 62 elif isinstance(failure, (test_failures.FailureAudioMismatch,
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 'diff_filename': self._output_testname(self.FILENAME_SUFFIX_IMAGE_DI FF), 265 'diff_filename': self._output_testname(self.FILENAME_SUFFIX_IMAGE_DI FF),
265 'prefix': self._output_testname(''), 266 'prefix': self._output_testname(''),
266 } 267 }
267 self._filesystem.write_text_file(diffs_html_filename, html) 268 self._filesystem.write_text_file(diffs_html_filename, html)
268 269
269 def write_reftest(self, src_filepath): 270 def write_reftest(self, src_filepath):
270 fs = self._filesystem 271 fs = self._filesystem
271 dst_dir = fs.dirname(fs.join(self._root_output_dir, self._test_name)) 272 dst_dir = fs.dirname(fs.join(self._root_output_dir, self._test_name))
272 dst_filepath = fs.join(dst_dir, fs.basename(src_filepath)) 273 dst_filepath = fs.join(dst_dir, fs.basename(src_filepath))
273 self._write_text_file(dst_filepath, fs.read_text_file(src_filepath)) 274 self._write_text_file(dst_filepath, fs.read_text_file(src_filepath))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698