2010-08-17 Dirk Pranke <dpranke@chromium.org>
authordpranke@chromium.org <dpranke@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Aug 2010 00:59:47 +0000 (00:59 +0000)
committerdpranke@chromium.org <dpranke@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Aug 2010 00:59:47 +0000 (00:59 +0000)
        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:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65578 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitTools/ChangeLog
WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing.py
WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py
WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py
WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py

index b747e702e551b9769e22bc3b6959c38865499403..5ab6a62ca74c9b8a2bf6f865fca960256ff48bdf 100644 (file)
@@ -1,3 +1,23 @@
+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.
index f838a7b6be8cffc9a67646830775d9e15df44583..81cdc9b67ba555302023965389f4f0bab48a0aad 100644 (file)
@@ -123,12 +123,6 @@ def print_options():
             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)")),
     ]
 
 
index e326f5cd5b466e9a6741b63c50159cb42d2607e9..b26bc6c6889c4d77facb27896d2abd63463b15e1 100755 (executable)
@@ -578,8 +578,6 @@ class TestRunner:
         test_args.new_baseline = self._options.new_baseline
         test_args.reset_results = self._options.reset_results
 
-        test_args.show_sources = self._options.sources
-
         if self._options.startup_dialog:
             shell_args.append('--testshell-startup-dialog')
 
@@ -1658,8 +1656,6 @@ def parse_args(args=None):
     option_parser = optparse.OptionParser(option_list=option_list)
 
     options, args = option_parser.parse_args(args)
-    if options.sources:
-        options.verbose = True
 
     return options, args
 
index 2a546865da076d8f642c3178bf31310f468ac50a..c9f4107998b1dd03f865036a6f00b77a00342c65 100644 (file)
@@ -144,10 +144,6 @@ class ImageDiff(test_type_base.TestTypeBase):
                                                           '.checksum')
         expected_png_file = self._port.expected_filename(filename, '.png')
 
-        if test_args.show_sources:
-            _log.debug('Using %s' % expected_hash_file)
-            _log.debug('Using %s' % expected_png_file)
-
         # FIXME: We repeat this pattern often, we should share code.
         try:
             with codecs.open(expected_hash_file, "r", "ascii") as file:
index 8db2e3df53b95ecb7689a1efe6600124d194b2b7..dd44642b2512246aec3853e601fc011182b2f8b8 100644 (file)
@@ -58,9 +58,6 @@ class TestArguments(object):
     # Whether to use wdiff to generate by-word diffs.
     wdiff = False
 
-    # Whether to report the locations of the expected result files used.
-    show_sources = False
-
 # Python bug workaround.  See the wdiff code in WriteOutputFiles for an
 # explanation.
 _wdiff_available = True
index 18f74b897f38889ab51ef42c1cf681b6e3335ca2..d06ec8d34659f122ed5e8a91e0bc6e26d75d44fa 100644 (file)
@@ -48,25 +48,22 @@ _log = logging.getLogger("webkitpy.layout_tests.test_types.text_diff")
 
 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,
@@ -94,13 +91,12 @@ class TestTextDiff(test_type_base.TestTypeBase):
             # 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):
@@ -127,5 +123,5 @@ class TestTextDiff(test_type_base.TestTypeBase):
           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))