[Windows] Ignore render tree dump based results on Windows
https://bugs.webkit.org/show_bug.cgi?id=209897

Reviewed by Darin Adler.

Render tree dumps are port specific and so difficult to maintain. They are mostly very old and
have been superseded by more modern ref and text dump tests. They rarely reveal any port specific bugs.

This patch adds --ignore-render-tree-dump-results option to run-webkit-tests and enables it by
default on Apple Windows port.

With the option set the render tree dump tests are still run (so crashes are detected) but their
output is treated as if it always passed. Missing results are not written to disk.

* Scripts/webkitpy/layout_tests/controllers/single_test_runner.py:
(SingleTestRunner._compare_text):
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(parse_args):
(_set_up_derived_options):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@259446 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index a7c67d9..340aa07 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,3 +1,25 @@
+2020-04-03  Antti Koivisto  <antti@apple.com>
+
+        [Windows] Ignore render tree dump based results on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=209897
+
+        Reviewed by Darin Adler.
+
+        Render tree dumps are port specific and so difficult to maintain. They are mostly very old and
+        have been superseded by more modern ref and text dump tests. They rarely reveal any port specific bugs.
+
+        This patch adds --ignore-render-tree-dump-results option to run-webkit-tests and enables it by
+        default on Apple Windows port.
+
+        With the option set the render tree dump tests are still run (so crashes are detected) but their
+        output is treated as if it always passed. Missing results are not written to disk.
+
+        * Scripts/webkitpy/layout_tests/controllers/single_test_runner.py:
+        (SingleTestRunner._compare_text):
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+        (parse_args):
+        (_set_up_derived_options):
+
 2020-04-02  James Savage  <james.savage@apple.com>
 
         Add myself, as a committer, to contributors.json.
diff --git a/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py b/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py
index cbfc2c0..58e029d 100644
--- a/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py
+++ b/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py
@@ -235,6 +235,8 @@
 
     def _compare_text(self, expected_text, actual_text):
         failures = []
+        if self._options.ignore_render_tree_dump_results and self._render_tree_dump_pattern.match(actual_text):
+            return failures
         if (expected_text and actual_text and
             # Assuming expected_text is already normalized.
             self._port.do_text_results_differ(expected_text, self._get_normalized_output_text(actual_text))):
diff --git a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
index e0e1927..1e9567e 100755
--- a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
+++ b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
@@ -149,6 +149,9 @@
             dest="sample_on_timeout", help="Don't run sample on timeout (OS X only)"),
         optparse.make_option("--no-ref-tests", action="store_true",
             dest="no_ref_tests", help="Skip all ref tests"),
+        optparse.make_option("--ignore-render-tree-dump-results", action="store_true",
+            dest="ignore_render_tree_dump_results",
+            help="Don't compare or save results for render tree dump tests (they still run and crashes are reported)"),
         optparse.make_option("--tolerance",
             help="Ignore image differences less than this percentage (some "
                 "ports may ignore this option)", type="float"),
@@ -469,6 +472,10 @@
     if options.platform in ["gtk", "wpe"]:
         options.webkit_test_runner = True
 
+    # Don't maintain render tree dump results for Apple Windows port.
+    if port.port_name == "win":
+        options.ignore_render_tree_dump_results = True
+
     if options.leaks:
         options.additional_env_var.append("JSC_usePoisoning=0")
         options.additional_env_var.append("__XPC_JSC_usePoisoning=0")