+2010-08-17 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by David Levin.
+
+ new-run-webkit-tests: remove --show-sources option
+
+ --show-sources is pretty much obsolete with --trace everything, so
+ I'm removing it.
+
+ Also rename a couple of methods in the TestTextDiff class to make their
+ intended visibility (private) more obvious.
+
+ https://bugs.webkit.org/show_bug.cgi?id=44143
+
+ * Scripts/webkitpy/layout_tests/layout_package/printing.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+
2010-08-17 Dirk Pranke <dpranke@chromium.org>
Reviewed by David Levin.
help="show detailed help on controlling print output"),
optparse.make_option("-v", "--verbose", action="store_true",
default=False, help="include debug-level logging"),
-
- # FIXME: we should remove this; it's pretty much obsolete with the
- # --print trace-everything option.
- optparse.make_option("--sources", action="store_true",
- help=("show expected result file path for each test "
- "(implies --verbose)")),
]
class TestTextDiff(test_type_base.TestTypeBase):
- def get_normalized_output_text(self, output):
+ def _get_normalized_output_text(self, output):
# Some tests produce "\r\n" explicitly. Our system (Python/Cygwin)
# helpfully changes the "\n" to "\r\n", resulting in "\r\r\n".
norm = output.replace("\r\r\n", "\r\n").strip("\r\n").replace(
"\r\n", "\n")
return norm + "\n"
- def get_normalized_expected_text(self, filename, show_sources):
+ def _get_normalized_expected_text(self, filename):
"""Given the filename of the test, read the expected output from a file
and normalize the text. Returns a string with the expected text, or ''
if the expected output file was not found."""
# Read the port-specific expected text.
expected_filename = self._port.expected_filename(filename, '.txt')
- if show_sources:
- _log.debug('Using %s' % expected_filename)
+ return self._get_normalized_text(expected_filename)
- return self.get_normalized_text(expected_filename)
-
- def get_normalized_text(self, filename):
+ def _get_normalized_text(self, filename):
# FIXME: We repeat this pattern often, we should share code.
try:
# NOTE: -expected.txt files are ALWAYS utf-8. However,
# we do not ever decode it inside run-webkit-tests. For some tests
# DumpRenderTree may not output utf-8 text (e.g. webarchives).
self._save_baseline_data(filename, output, ".txt", encoding=None,
- generate_new_baseline=test_args.new_baseline)
+ generate_new_baseline=test_args.new_baseline)
return failures
# Normalize text to diff
- output = self.get_normalized_output_text(output)
- expected = self.get_normalized_expected_text(filename,
- test_args.show_sources)
+ output = self._get_normalized_output_text(output)
+ expected = self._get_normalized_expected_text(filename)
# Write output files for new tests, too.
if port.compare_text(output, expected):
False otherwise.
"""
- return port.compare_text(self.get_normalized_text(file1),
- self.get_normalized_text(file2))
+ return port.compare_text(self._get_normalized_text(file1),
+ self._get_normalized_text(file2))