Title: [271867] trunk
Revision
271867
Author
jbed...@apple.com
Date
2021-01-25 16:33:44 -0800 (Mon, 25 Jan 2021)

Log Message

[run-webkit-tests] Support python layout tests
https://bugs.webkit.org/show_bug.cgi?id=220749
Tools:

<rdar://problem/73375271>

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py:
(LayoutTestFinder._real_tests): Exclude "tools" directories.
(LayoutTestFinder._is_test_file): Special case for web socket's *_wsh.py files.
(LayoutTestFinder._is_w3c_resource_file): Exclude w3c Python files.

LayoutTests:

Reviewed by Alexey Proskuryakov.

* html5lib/generate-test-wrappers: Copied from LayoutTests/html5lib/generate-test-wrappers.py.
* html5lib/generate-test-wrappers.py: Removed.
* http/conf/apache2.2-httpd.conf: Allow .py files to be run as CGI binaries.
* http/conf/apache2.4-httpd.conf: Ditto.
* http/conf/apache2.4-php7-httpd.conf: Ditto.
* http/conf/archlinux-httpd.conf: Ditto.
* http/conf/debian-httpd-2.4-php7.0.conf: Ditto.
* http/conf/debian-httpd-2.4-php7.1.conf: Ditto.
* http/conf/debian-httpd-2.4-php7.2.conf: Ditto.
* http/conf/debian-httpd-2.4-php7.3.conf: Ditto.
* http/conf/debian-httpd-2.4-php7.4.conf: Ditto.
* http/conf/fedora-httpd-2.2.conf: Ditto.
* http/conf/fedora-httpd-2.4-php7.conf: Ditto.
* http/conf/fedora-httpd-2.4.conf: Ditto.
* http/conf/flatpak-httpd.conf: Ditto.
* http/conf/win-httpd-2.4-php5.conf: Ditto.
* http/conf/win-httpd-2.4-php7.conf: Ditto.
* media/track/opera/track/webvtt/parsing-cue-data/buildtests: Copied from LayoutTests/media/track/opera/track/webvtt/parsing-cue-data/buildtests.py.
* media/track/opera/track/webvtt/parsing-cue-data/buildtests.py: Removed.
* webgl/generate-webgl-tests: Copied from LayoutTests/webgl/generate-webgl-tests.py.
* webgl/generate-webgl-tests.py: Removed.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (271866 => 271867)


--- trunk/LayoutTests/ChangeLog	2021-01-25 23:32:13 UTC (rev 271866)
+++ trunk/LayoutTests/ChangeLog	2021-01-26 00:33:44 UTC (rev 271867)
@@ -1,3 +1,32 @@
+2021-01-25  Jonathan Bedard  <jbed...@apple.com>
+
+        [run-webkit-tests] Support python layout tests
+        https://bugs.webkit.org/show_bug.cgi?id=220749
+
+        Reviewed by Alexey Proskuryakov.
+
+        * html5lib/generate-test-wrappers: Copied from LayoutTests/html5lib/generate-test-wrappers.py.
+        * html5lib/generate-test-wrappers.py: Removed.
+        * http/conf/apache2.2-httpd.conf: Allow .py files to be run as CGI binaries.
+        * http/conf/apache2.4-httpd.conf: Ditto.
+        * http/conf/apache2.4-php7-httpd.conf: Ditto.
+        * http/conf/archlinux-httpd.conf: Ditto.
+        * http/conf/debian-httpd-2.4-php7.0.conf: Ditto.
+        * http/conf/debian-httpd-2.4-php7.1.conf: Ditto.
+        * http/conf/debian-httpd-2.4-php7.2.conf: Ditto.
+        * http/conf/debian-httpd-2.4-php7.3.conf: Ditto.
+        * http/conf/debian-httpd-2.4-php7.4.conf: Ditto.
+        * http/conf/fedora-httpd-2.2.conf: Ditto.
+        * http/conf/fedora-httpd-2.4-php7.conf: Ditto.
+        * http/conf/fedora-httpd-2.4.conf: Ditto.
+        * http/conf/flatpak-httpd.conf: Ditto.
+        * http/conf/win-httpd-2.4-php5.conf: Ditto.
+        * http/conf/win-httpd-2.4-php7.conf: Ditto.
+        * media/track/opera/track/webvtt/parsing-cue-data/buildtests: Copied from LayoutTests/media/track/opera/track/webvtt/parsing-cue-data/buildtests.py.
+        * media/track/opera/track/webvtt/parsing-cue-data/buildtests.py: Removed.
+        * webgl/generate-webgl-tests: Copied from LayoutTests/webgl/generate-webgl-tests.py.
+        * webgl/generate-webgl-tests.py: Removed.
+
 2021-01-25  Sam Weinig  <wei...@apple.com>
 
         Support percentages when parsing color(srgb ...) and color(display-p3 ...) per-spec

Copied: trunk/LayoutTests/html5lib/generate-test-wrappers (from rev 271866, trunk/LayoutTests/html5lib/generate-test-wrappers.py) (0 => 271867)


--- trunk/LayoutTests/html5lib/generate-test-wrappers	                        (rev 0)
+++ trunk/LayoutTests/html5lib/generate-test-wrappers	2021-01-26 00:33:44 UTC (rev 271867)
@@ -0,0 +1,124 @@
+#!/usr/bin/env python
+# Copyright (c) 2013 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#     * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Used for generating LayoutTest-compatible html files to run html5lib *.dat files.
+
+import os
+import glob
+
+
+class WrapperGenerator(object):
+    INPUT_DIRECTORY = "resources"
+    INPUT_SUFFIX = ".dat"
+    OUTPUT_DIRECTORY = "generated"
+    HARNESS_PREFIX = "run-"
+    HARNESS_SUFFIX = ".html"
+    EXPECTAION_SUFFIX = "-expected.txt"
+    HARNESS_TYPES = ("write", "data")
+
+    HARNESS_TEMPLATE = """<!DOCTYPE html>
+<script>
+var test_files = [ '%(test_path)s' ]
+</script>
+<script src=""
+%(extra_content)s
+<script src=""
+"""
+
+    def _files_in_directory_with_suffix(self, directory, suffix):
+        return glob.glob(os.path.join(directory, '*' + suffix))
+
+    def _last_path_component_removing_suffix(self, path, suffix):
+        return os.path.split(path)[-1][:-len(suffix)]
+
+    def _remove_harness_prefix(self, name):
+        assert(name.startswith(self.HARNESS_PREFIX))
+        return name[len(self.HARNESS_PREFIX):]
+
+    def _remove_harness_type(self, name):
+        parts = name.split('-')
+        assert(parts[-1] in self.HARNESS_TYPES)
+        return "-".join(parts[:-1])
+
+    def _test_name_from_harness_name(self, name):
+        name = self._remove_harness_prefix(name)
+        return self._remove_harness_type(name)
+
+    def _remove_stale_tests(self, test_names):
+        for path in self._files_in_directory_with_suffix(self.OUTPUT_DIRECTORY, self.HARNESS_SUFFIX):
+            name = self._last_path_component_removing_suffix(path, self.HARNESS_SUFFIX)
+            name = self._test_name_from_harness_name(name)
+            if name not in test_names:
+                print("Removing %s, %s no longer exists." % (path, self._input_path(name)))
+                os.remove(path)
+
+        for path in self._files_in_directory_with_suffix(self.OUTPUT_DIRECTORY, self.EXPECTAION_SUFFIX):
+            name = self._last_path_component_removing_suffix(path, self.EXPECTAION_SUFFIX)
+            name = self._test_name_from_harness_name(name)
+            if name not in test_names:
+                print("Removing %s, %s no longer exists." % (path, self._input_path(name)))
+                os.remove(path)
+
+    def _input_path(self, test_name):
+        return os.path.join(self.INPUT_DIRECTORY, test_name + self.INPUT_SUFFIX)
+
+    def _harness_path(self, test_name, use_write):
+        harness_path = os.path.join(self.OUTPUT_DIRECTORY, self.HARNESS_PREFIX + test_name)
+        if use_write:
+            harness_path += "-write"
+        else:
+            harness_path += "-data"
+        return harness_path + self.HARNESS_SUFFIX
+
+    def _harness_content(self, test_name, use_write):
+        extra_content = ""
+        if not use_write:
+            extra_content = "<script>window.forceDataURLs = true;</script>";
+        return self.HARNESS_TEMPLATE % {
+            # FIXME: .. should be relative to the number of components in OUTPUT_DIRECTORY
+            'test_path': os.path.join('..', self._input_path(test_name)),
+            'extra_content': extra_content,
+        }
+
+    def _write_harness(self, test_name, use_write):
+        harness_file = open(self._harness_path(test_name, use_write), "w")
+        harness_file.write(self._harness_content(test_name, use_write))
+
+    def main(self):
+        test_names = [self._last_path_component_removing_suffix(path, self.INPUT_SUFFIX) for path in self._files_in_directory_with_suffix(self.INPUT_DIRECTORY, self.INPUT_SUFFIX)]
+
+        self._remove_stale_tests(test_names)
+
+        for name in test_names:
+            self._write_harness(name, True)
+            self._write_harness(name, False)
+
+
+if __name__ == "__main__":
+    WrapperGenerator().main()

Deleted: trunk/LayoutTests/html5lib/generate-test-wrappers.py (271866 => 271867)


--- trunk/LayoutTests/html5lib/generate-test-wrappers.py	2021-01-25 23:32:13 UTC (rev 271866)
+++ trunk/LayoutTests/html5lib/generate-test-wrappers.py	2021-01-26 00:33:44 UTC (rev 271867)
@@ -1,124 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2013 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# Used for generating LayoutTest-compatible html files to run html5lib *.dat files.
-
-import os
-import glob
-
-
-class WrapperGenerator(object):
-    INPUT_DIRECTORY = "resources"
-    INPUT_SUFFIX = ".dat"
-    OUTPUT_DIRECTORY = "generated"
-    HARNESS_PREFIX = "run-"
-    HARNESS_SUFFIX = ".html"
-    EXPECTAION_SUFFIX = "-expected.txt"
-    HARNESS_TYPES = ("write", "data")
-
-    HARNESS_TEMPLATE = """<!DOCTYPE html>
-<script>
-var test_files = [ '%(test_path)s' ]
-</script>
-<script src=""
-%(extra_content)s
-<script src=""
-"""
-
-    def _files_in_directory_with_suffix(self, directory, suffix):
-        return glob.glob(os.path.join(directory, '*' + suffix))
-
-    def _last_path_component_removing_suffix(self, path, suffix):
-        return os.path.split(path)[-1][:-len(suffix)]
-
-    def _remove_harness_prefix(self, name):
-        assert(name.startswith(self.HARNESS_PREFIX))
-        return name[len(self.HARNESS_PREFIX):]
-
-    def _remove_harness_type(self, name):
-        parts = name.split('-')
-        assert(parts[-1] in self.HARNESS_TYPES)
-        return "-".join(parts[:-1])
-
-    def _test_name_from_harness_name(self, name):
-        name = self._remove_harness_prefix(name)
-        return self._remove_harness_type(name)
-
-    def _remove_stale_tests(self, test_names):
-        for path in self._files_in_directory_with_suffix(self.OUTPUT_DIRECTORY, self.HARNESS_SUFFIX):
-            name = self._last_path_component_removing_suffix(path, self.HARNESS_SUFFIX)
-            name = self._test_name_from_harness_name(name)
-            if name not in test_names:
-                print("Removing %s, %s no longer exists." % (path, self._input_path(name)))
-                os.remove(path)
-
-        for path in self._files_in_directory_with_suffix(self.OUTPUT_DIRECTORY, self.EXPECTAION_SUFFIX):
-            name = self._last_path_component_removing_suffix(path, self.EXPECTAION_SUFFIX)
-            name = self._test_name_from_harness_name(name)
-            if name not in test_names:
-                print("Removing %s, %s no longer exists." % (path, self._input_path(name)))
-                os.remove(path)
-
-    def _input_path(self, test_name):
-        return os.path.join(self.INPUT_DIRECTORY, test_name + self.INPUT_SUFFIX)
-
-    def _harness_path(self, test_name, use_write):
-        harness_path = os.path.join(self.OUTPUT_DIRECTORY, self.HARNESS_PREFIX + test_name)
-        if use_write:
-            harness_path += "-write"
-        else:
-            harness_path += "-data"
-        return harness_path + self.HARNESS_SUFFIX
-
-    def _harness_content(self, test_name, use_write):
-        extra_content = ""
-        if not use_write:
-            extra_content = "<script>window.forceDataURLs = true;</script>";
-        return self.HARNESS_TEMPLATE % {
-            # FIXME: .. should be relative to the number of components in OUTPUT_DIRECTORY
-            'test_path': os.path.join('..', self._input_path(test_name)),
-            'extra_content': extra_content,
-        }
-
-    def _write_harness(self, test_name, use_write):
-        harness_file = open(self._harness_path(test_name, use_write), "w")
-        harness_file.write(self._harness_content(test_name, use_write))
-
-    def main(self):
-        test_names = [self._last_path_component_removing_suffix(path, self.INPUT_SUFFIX) for path in self._files_in_directory_with_suffix(self.INPUT_DIRECTORY, self.INPUT_SUFFIX)]
-
-        self._remove_stale_tests(test_names)
-
-        for name in test_names:
-            self._write_harness(name, True)
-            self._write_harness(name, False)
-
-
-if __name__ == "__main__":
-    WrapperGenerator().main()

Modified: trunk/LayoutTests/http/conf/apache2.2-httpd.conf (271866 => 271867)


--- trunk/LayoutTests/http/conf/apache2.2-httpd.conf	2021-01-25 23:32:13 UTC (rev 271866)
+++ trunk/LayoutTests/http/conf/apache2.2-httpd.conf	2021-01-26 00:33:44 UTC (rev 271867)
@@ -108,7 +108,7 @@
     AddEncoding x-compress .Z
     AddEncoding x-gzip .gz .tgz
 
-    AddHandler cgi-script .cgi .pl
+    AddHandler cgi-script .cgi .pl .py
 
     AddType text/html .shtml
     AddHandler server-parsed .shtml

Modified: trunk/LayoutTests/http/conf/apache2.4-httpd.conf (271866 => 271867)


--- trunk/LayoutTests/http/conf/apache2.4-httpd.conf	2021-01-25 23:32:13 UTC (rev 271866)
+++ trunk/LayoutTests/http/conf/apache2.4-httpd.conf	2021-01-26 00:33:44 UTC (rev 271867)
@@ -115,7 +115,7 @@
     AddEncoding x-compress .Z
     AddEncoding x-gzip .gz .tgz
 
-    AddHandler cgi-script .cgi .pl
+    AddHandler cgi-script .cgi .pl .py
 
     AddType text/html .shtml
     AddHandler server-parsed .shtml

Modified: trunk/LayoutTests/http/conf/apache2.4-php7-httpd.conf (271866 => 271867)


--- trunk/LayoutTests/http/conf/apache2.4-php7-httpd.conf	2021-01-25 23:32:13 UTC (rev 271866)
+++ trunk/LayoutTests/http/conf/apache2.4-php7-httpd.conf	2021-01-26 00:33:44 UTC (rev 271867)
@@ -119,7 +119,7 @@
     AddEncoding x-compress .Z
     AddEncoding x-gzip .gz .tgz
 
-    AddHandler cgi-script .cgi .pl
+    AddHandler cgi-script .cgi .pl .py
 
     AddType text/html .shtml
     AddHandler server-parsed .shtml

Modified: trunk/LayoutTests/http/conf/archlinux-httpd.conf (271866 => 271867)


--- trunk/LayoutTests/http/conf/archlinux-httpd.conf	2021-01-25 23:32:13 UTC (rev 271866)
+++ trunk/LayoutTests/http/conf/archlinux-httpd.conf	2021-01-26 00:33:44 UTC (rev 271867)
@@ -109,7 +109,7 @@
 AddType application/x-x509-ca-cert .crt
 AddType application/x-pkcs7-crl    .crl
 
-AddHandler cgi-script .cgi .pl
+AddHandler cgi-script .cgi .pl .py
 
 AddType text/html .shtml
 AddOutputFilter INCLUDES .shtml

Modified: trunk/LayoutTests/http/conf/debian-httpd-2.4-php7.0.conf (271866 => 271867)


--- trunk/LayoutTests/http/conf/debian-httpd-2.4-php7.0.conf	2021-01-25 23:32:13 UTC (rev 271866)
+++ trunk/LayoutTests/http/conf/debian-httpd-2.4-php7.0.conf	2021-01-26 00:33:44 UTC (rev 271867)
@@ -105,7 +105,7 @@
 AddType application/x-x509-ca-cert .crt
 AddType application/x-pkcs7-crl    .crl
 
-AddHandler cgi-script .cgi .pl
+AddHandler cgi-script .cgi .pl .py
 
 AddType text/html .shtml
 AddOutputFilter INCLUDES .shtml

Modified: trunk/LayoutTests/http/conf/debian-httpd-2.4-php7.1.conf (271866 => 271867)


--- trunk/LayoutTests/http/conf/debian-httpd-2.4-php7.1.conf	2021-01-25 23:32:13 UTC (rev 271866)
+++ trunk/LayoutTests/http/conf/debian-httpd-2.4-php7.1.conf	2021-01-26 00:33:44 UTC (rev 271867)
@@ -105,7 +105,7 @@
 AddType application/x-x509-ca-cert .crt
 AddType application/x-pkcs7-crl    .crl
 
-AddHandler cgi-script .cgi .pl
+AddHandler cgi-script .cgi .pl .py
 
 AddType text/html .shtml
 AddOutputFilter INCLUDES .shtml

Modified: trunk/LayoutTests/http/conf/debian-httpd-2.4-php7.2.conf (271866 => 271867)


--- trunk/LayoutTests/http/conf/debian-httpd-2.4-php7.2.conf	2021-01-25 23:32:13 UTC (rev 271866)
+++ trunk/LayoutTests/http/conf/debian-httpd-2.4-php7.2.conf	2021-01-26 00:33:44 UTC (rev 271867)
@@ -105,7 +105,7 @@
 AddType application/x-x509-ca-cert .crt
 AddType application/x-pkcs7-crl    .crl
 
-AddHandler cgi-script .cgi .pl
+AddHandler cgi-script .cgi .pl .py
 
 AddType text/html .shtml
 AddOutputFilter INCLUDES .shtml

Modified: trunk/LayoutTests/http/conf/debian-httpd-2.4-php7.3.conf (271866 => 271867)


--- trunk/LayoutTests/http/conf/debian-httpd-2.4-php7.3.conf	2021-01-25 23:32:13 UTC (rev 271866)
+++ trunk/LayoutTests/http/conf/debian-httpd-2.4-php7.3.conf	2021-01-26 00:33:44 UTC (rev 271867)
@@ -105,7 +105,7 @@
 AddType application/x-x509-ca-cert .crt
 AddType application/x-pkcs7-crl    .crl
 
-AddHandler cgi-script .cgi .pl
+AddHandler cgi-script .cgi .pl .py
 
 AddType text/html .shtml
 AddOutputFilter INCLUDES .shtml

Modified: trunk/LayoutTests/http/conf/debian-httpd-2.4-php7.4.conf (271866 => 271867)


--- trunk/LayoutTests/http/conf/debian-httpd-2.4-php7.4.conf	2021-01-25 23:32:13 UTC (rev 271866)
+++ trunk/LayoutTests/http/conf/debian-httpd-2.4-php7.4.conf	2021-01-26 00:33:44 UTC (rev 271867)
@@ -105,7 +105,7 @@
 AddType application/x-x509-ca-cert .crt
 AddType application/x-pkcs7-crl    .crl
 
-AddHandler cgi-script .cgi .pl
+AddHandler cgi-script .cgi .pl .py
 
 AddType text/html .shtml
 AddOutputFilter INCLUDES .shtml

Modified: trunk/LayoutTests/http/conf/fedora-httpd-2.2.conf (271866 => 271867)


--- trunk/LayoutTests/http/conf/fedora-httpd-2.2.conf	2021-01-25 23:32:13 UTC (rev 271866)
+++ trunk/LayoutTests/http/conf/fedora-httpd-2.2.conf	2021-01-26 00:33:44 UTC (rev 271867)
@@ -111,7 +111,7 @@
 AddType application/x-x509-ca-cert .crt
 AddType application/x-pkcs7-crl    .crl
 
-AddHandler cgi-script .cgi .pl
+AddHandler cgi-script .cgi .pl .py
 
 AddType text/html .shtml
 AddOutputFilter INCLUDES .shtml

Modified: trunk/LayoutTests/http/conf/fedora-httpd-2.4-php7.conf (271866 => 271867)


--- trunk/LayoutTests/http/conf/fedora-httpd-2.4-php7.conf	2021-01-25 23:32:13 UTC (rev 271866)
+++ trunk/LayoutTests/http/conf/fedora-httpd-2.4-php7.conf	2021-01-26 00:33:44 UTC (rev 271867)
@@ -109,7 +109,7 @@
 AddType application/x-x509-ca-cert .crt
 AddType application/x-pkcs7-crl    .crl
 
-AddHandler cgi-script .cgi .pl
+AddHandler cgi-script .cgi .pl .py
 
 AddType text/html .shtml
 AddOutputFilter INCLUDES .shtml

Modified: trunk/LayoutTests/http/conf/fedora-httpd-2.4.conf (271866 => 271867)


--- trunk/LayoutTests/http/conf/fedora-httpd-2.4.conf	2021-01-25 23:32:13 UTC (rev 271866)
+++ trunk/LayoutTests/http/conf/fedora-httpd-2.4.conf	2021-01-26 00:33:44 UTC (rev 271867)
@@ -109,7 +109,7 @@
 AddType application/x-x509-ca-cert .crt
 AddType application/x-pkcs7-crl    .crl
 
-AddHandler cgi-script .cgi .pl
+AddHandler cgi-script .cgi .pl .py
 
 AddType text/html .shtml
 AddOutputFilter INCLUDES .shtml

Modified: trunk/LayoutTests/http/conf/flatpak-httpd.conf (271866 => 271867)


--- trunk/LayoutTests/http/conf/flatpak-httpd.conf	2021-01-25 23:32:13 UTC (rev 271866)
+++ trunk/LayoutTests/http/conf/flatpak-httpd.conf	2021-01-26 00:33:44 UTC (rev 271867)
@@ -108,7 +108,7 @@
 AddType application/x-x509-ca-cert .crt
 AddType application/x-pkcs7-crl    .crl
 
-AddHandler cgi-script .cgi .pl
+AddHandler cgi-script .cgi .pl .py
 
 AddType text/html .shtml
 AddOutputFilter INCLUDES .shtml

Modified: trunk/LayoutTests/http/conf/win-httpd-2.4-php5.conf (271866 => 271867)


--- trunk/LayoutTests/http/conf/win-httpd-2.4-php5.conf	2021-01-25 23:32:13 UTC (rev 271866)
+++ trunk/LayoutTests/http/conf/win-httpd-2.4-php5.conf	2021-01-26 00:33:44 UTC (rev 271867)
@@ -117,7 +117,7 @@
     AddEncoding x-compress .Z
     AddEncoding x-gzip .gz .tgz
 
-    AddHandler cgi-script .cgi .pl
+    AddHandler cgi-script .cgi .pl .py
 
     AddType text/html .shtml
     AddHandler server-parsed .shtml

Modified: trunk/LayoutTests/http/conf/win-httpd-2.4-php7.conf (271866 => 271867)


--- trunk/LayoutTests/http/conf/win-httpd-2.4-php7.conf	2021-01-25 23:32:13 UTC (rev 271866)
+++ trunk/LayoutTests/http/conf/win-httpd-2.4-php7.conf	2021-01-26 00:33:44 UTC (rev 271867)
@@ -102,7 +102,7 @@
     AddEncoding x-compress .Z
     AddEncoding x-gzip .gz .tgz
 
-    AddHandler cgi-script .cgi .pl
+    AddHandler cgi-script .cgi .pl .py
 
     AddType text/html .shtml
     AddHandler server-parsed .shtml

Copied: trunk/LayoutTests/media/track/opera/track/webvtt/parsing-cue-data/buildtests (from rev 271866, trunk/LayoutTests/media/track/opera/track/webvtt/parsing-cue-data/buildtests.py) (0 => 271867)


--- trunk/LayoutTests/media/track/opera/track/webvtt/parsing-cue-data/buildtests	                        (rev 0)
+++ trunk/LayoutTests/media/track/opera/track/webvtt/parsing-cue-data/buildtests	2021-01-26 00:33:44 UTC (rev 271867)
@@ -0,0 +1,67 @@
+#!/usr/bin/python
+
+import os
+import urllib
+import hashlib
+
+doctmpl = """<!doctype html>
+<title>WebVTT cue data parser test %s</title>
+<style>video { display:none }</style>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<div id=log></div>
+<script>
+runTests([
+%s
+]);
+</script>"""
+
+testobj = "{name:'%s', input:'%s', expected:'%s'}"
+
+def appendtest(tests, input, expected):
+    tests.append(testobj % (hashlib.sha1(input).hexdigest(), urllib.quote(input[:-1]),  urllib.quote(expected[:-1])))
+
+files = os.listdir('dat/')
+for file in files:
+    if os.path.isdir('dat/'+file) or file[0] == ".":
+        continue
+    tests = []
+    input = ""
+    expected = ""
+    state = ""
+    f = open('dat/'+file)
+    while 1:
+        line = f.readline()
+        if not line:
+            if state != "":
+                appendtest(tests, input, expected)
+                input = ""
+                expected = ""
+                state = ""
+            break
+        if line[0] == "#":
+            state = line
+            if line == "#document-fragment\n":
+                expected = expected + line
+        elif state == "#data\n":
+            input = input + line
+        elif state == "#errors\n":
+            pass
+        elif state == "#document-fragment\n":
+            if line == "\n":
+                appendtest(tests, input, expected)
+                input = ""
+                expected = ""
+                state = ""
+            else:
+                expected = expected + line
+        else:
+            raise Exception("failed to parse file "+file+" line:"+line+" (state: "+state+")")
+    f.close()
+    barename = file.replace(".dat", "")
+    out = open('tests/'+barename+".html", "w")
+    out.write(doctmpl % (barename, ",\n".join(tests)))
+    out.close()

Deleted: trunk/LayoutTests/media/track/opera/track/webvtt/parsing-cue-data/buildtests.py (271866 => 271867)


--- trunk/LayoutTests/media/track/opera/track/webvtt/parsing-cue-data/buildtests.py	2021-01-25 23:32:13 UTC (rev 271866)
+++ trunk/LayoutTests/media/track/opera/track/webvtt/parsing-cue-data/buildtests.py	2021-01-26 00:33:44 UTC (rev 271867)
@@ -1,67 +0,0 @@
-#!/usr/bin/python
-
-import os
-import urllib
-import hashlib
-
-doctmpl = """<!doctype html>
-<title>WebVTT cue data parser test %s</title>
-<style>video { display:none }</style>
-<script src=""
-<script src=""
-<script src=""
-<script src=""
-<script src=""
-<div id=log></div>
-<script>
-runTests([
-%s
-]);
-</script>"""
-
-testobj = "{name:'%s', input:'%s', expected:'%s'}"
-
-def appendtest(tests, input, expected):
-    tests.append(testobj % (hashlib.sha1(input).hexdigest(), urllib.quote(input[:-1]),  urllib.quote(expected[:-1])))
-
-files = os.listdir('dat/')
-for file in files:
-    if os.path.isdir('dat/'+file) or file[0] == ".":
-        continue
-    tests = []
-    input = ""
-    expected = ""
-    state = ""
-    f = open('dat/'+file)
-    while 1:
-        line = f.readline()
-        if not line:
-            if state != "":
-                appendtest(tests, input, expected)
-                input = ""
-                expected = ""
-                state = ""
-            break
-        if line[0] == "#":
-            state = line
-            if line == "#document-fragment\n":
-                expected = expected + line
-        elif state == "#data\n":
-            input = input + line
-        elif state == "#errors\n":
-            pass
-        elif state == "#document-fragment\n":
-            if line == "\n":
-                appendtest(tests, input, expected)
-                input = ""
-                expected = ""
-                state = ""
-            else:
-                expected = expected + line
-        else:
-            raise Exception("failed to parse file "+file+" line:"+line+" (state: "+state+")")
-    f.close()
-    barename = file.replace(".dat", "")
-    out = open('tests/'+barename+".html", "w")
-    out.write(doctmpl % (barename, ",\n".join(tests)))
-    out.close()

Copied: trunk/LayoutTests/webgl/generate-webgl-tests (from rev 271866, trunk/LayoutTests/webgl/generate-webgl-tests.py) (0 => 271867)


--- trunk/LayoutTests/webgl/generate-webgl-tests	                        (rev 0)
+++ trunk/LayoutTests/webgl/generate-webgl-tests	2021-01-26 00:33:44 UTC (rev 271867)
@@ -0,0 +1,270 @@
+#!/usr/bin/env python3
+# Copyright (C) 2013 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#     * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""generates webgl layout tests from the Khronos WebGL Conformance Tests"""
+
+# To use this, get a copy of the WebGL conformance tests then run this script
+# eg.
+#
+#   cd ~/temp
+#   git clone git://github.com/KhronosGroup/WebGL.git
+#   cd ~/WebKit/LayoutTests/webgl
+#   python generate-webgl-tests.py -w ~/temp/WebGL/sdk/tests -e
+#
+# Now check run the LayoutTests, update TestExpectations and check in the
+# result.
+
+import copy
+import os
+import os.path
+import sys
+import re
+import json
+import shutil
+from optparse import OptionParser
+
+if sys.version < '2.6':
+  print 'Wrong Python Version !!!: Need >= 2.6'
+  sys.exit(1)
+
+
+GLOBAL_OPTIONS = {
+  # version use. Tests at or below this will be included.
+  "version": "2.0.0",
+
+  # version used for unlabled tests
+  "default-version": "2.0",
+
+  # If set, the version we require. Tests below this will be ignored.
+  "min-version": "1.0.3",
+}
+
+
+def ReadFile(filename):
+  """Reads a file as a string"""
+  file = open(filename, "r")
+  data = ""
+  file.close()
+  return data
+
+
+def WriteFile(filename, data):
+  """Writes a string as a file"""
+  print "Writing: ", filename
+  dirname = os.path.dirname(filename)
+  if not os.path.exists(dirname):
+    os.makedirs(dirname)
+  file = open(filename, "wb")
+  file.write(data)
+  file.close()
+
+
+def CopyTree(src, dst, ignore=None):
+  """Recursively copy a directory tree"""
+  names = os.listdir(src)
+  if ignore is not None:
+    ignored_names = ignore(src, names)
+  else:
+    ignored_names = set()
+
+  if not os.path.exists(dst):
+    os.makedirs(dst)
+  errors = []
+  for name in names:
+    if name in ignored_names:
+      continue
+    srcname = os.path.join(src, name)
+    dstname = os.path.join(dst, name)
+    try:
+      if os.path.isdir(srcname):
+        CopyTree(srcname, dstname, ignore)
+      else:
+        # Will raise a SpecialFileError for unsupported file types
+        shutil.copyfile(srcname, dstname)
+    # catch the Error from the recursive copytree so that we can
+    # continue with other files
+    except Error, err:
+      errors.extend(err.args[0])
+    except EnvironmentError, why:
+      errors.append((srcname, dstname, str(why)))
+  if errors:
+    raise Error, errors
+
+
+def FileReader(filename):
+  """A File generator that returns only non empty, non comment lines"""
+  file = open(filename, "r")
+  lines = file.readlines()
+  file.close()
+  for line_number, line in enumerate(lines):
+    line = line.strip()
+    if (len(line) > 0 and
+        not line.startswith("#") and
+        not line.startswith(";") and
+        not line.startswith("//")):
+      yield line_number + 1, line
+
+
+def GreaterThanOrEqualToVersion(have, want):
+  """Compares to version strings"""
+  have = have.split(" ")[0].split(".")
+  want = want.split(" ")[0].split(".")
+  for ndx, want_str in enumerate(want):
+    want_num = int(want_str)
+    have_num = 0
+    if ndx < len(have):
+      have_num = int(have[ndx])
+    if have_num < want_num:
+      return False
+    if have_num >= want_num:
+      return True
+  return True
+
+
+def GetTestList(list_filename, dest_dir, hierarchical_options):
+  global GLOBAL_OPTIONS
+  tests = []
+  prefix = os.path.dirname(list_filename)
+  for line_number, line in FileReader(list_filename):
+    args = line.split()
+    test_options = {}
+    non_options = []
+    use_test = True
+    while len(args):
+      arg = args.pop(0)
+      if arg.startswith("-"):
+        if not arg.startswith("--"):
+          raise "%s:%d bad option" % (list_filename, line_number)
+        option = arg[2:]
+        if option == 'slow':
+          pass
+        elif option == 'min-version' or option == "max-version":
+          test_options[option] = args.pop(0)
+        else:
+          raise Exception("%s:%d unknown option '%s'" % (list_filename, line_number, arg))
+      else:
+        non_options.append(arg)
+    url = "" " ".join(non_options))
+
+    if not url.endswith(".txt"):
+      if "min-version" in test_options:
+        min_version = test_options["min-version"]
+      else:
+        min_version = hierarchical_options["default-version"]
+
+      if "min-version" in GLOBAL_OPTIONS:
+        use_test = GreaterThanOrEqualToVersion(min_version, GLOBAL_OPTIONS["min-version"])
+      else:
+        use_test = GreaterThanOrEqualToVersion(GLOBAL_OPTIONS["version"], min_version)
+
+    if not use_test:
+      continue
+
+    if url.endswith(".txt"):
+      if "min-version" in test_options:
+        hierarchical_options["default-version"] = test_options["min-version"]
+      tests = tests + GetTestList(
+          os.path.join(prefix, url), dest_dir, copy.copy(hierarchical_options))
+    else:
+      tests.append({"url": url})
+  return tests
+
+
+def main(argv):
+  """This is the main function."""
+  global GLOBAL_OPTIONS
+
+  parser = OptionParser()
+  parser.add_option(
+      "-v", "--verbose", action=""
+      help="prints more output.")
+  parser.add_option(
+      "-w", "--webgl-conformance-test", dest="source_dir",
+      help="path to webgl conformance tests. REQUIRED")
+  parser.add_option(
+      "-n", "--no-copy", action=""
+      help="do not copy tests")
+  parser.add_option(
+      "-e", "--generate-expectations", action=""
+      help="generatet the test expectations")
+  parser.add_option(
+      "-o", "--output-dir", dest="output_dir",
+      help="base directory for output. defaults to \'.\'",
+      default=".")
+
+  (options, args) = parser.parse_args(args=argv)
+
+  if not options.source_dir:
+    parser.print_help()
+    return 1
+
+  os.chdir(os.path.dirname(__file__) or '.')
+
+  source_dir = options.source_dir;
+  output_dir = options.output_dir;
+  webgl_tests_dir = os.path.join(output_dir, "resources/webgl_test_files")
+
+  # copy all the files from the WebGL conformance tests.
+  if not options.no_copy:
+    CopyTree(
+        source_dir, webgl_tests_dir, shutil.ignore_patterns(
+            '.git', '*.pyc', 'tmp*'))
+
+  test_template = ReadFile("resources/webgl-wrapper-template.html")
+  expectation_template = ReadFile("resources/webgl-expectation-template.txt")
+
+  # generate wrappers for all the tests
+  tests = GetTestList(os.path.join(source_dir, "00_test_list.txt"), ".",
+                      copy.copy(GLOBAL_OPTIONS))
+
+  for test in tests:
+    url = "" source_dir)
+    dst = os.path.join(output_dir, url)
+    dst_dir = os.path.dirname(dst)
+    src = "" url), dst_dir).replace("\\", "/")
+    base_url = os.path.relpath(output_dir, dst_dir).replace("\\", "/")
+    subs = {
+      "url": src,
+      "url_name": os.path.basename(url),
+      "base_url": base_url,
+    }
+    WriteFile(dst, test_template % subs)
+    if options.generate_expectations:
+      expectation_filename = os.path.splitext(dst)[0] + "-expected.txt"
+      WriteFile(expectation_filename, expectation_template % subs)
+
+
+
+if __name__ == '__main__':
+  sys.exit(main(sys.argv[1:]))
+
+
+
+
+

Property changes: trunk/LayoutTests/webgl/generate-webgl-tests


Added: svn:executable

+* \ No newline at end of property

Deleted: trunk/LayoutTests/webgl/generate-webgl-tests.py (271866 => 271867)


--- trunk/LayoutTests/webgl/generate-webgl-tests.py	2021-01-25 23:32:13 UTC (rev 271866)
+++ trunk/LayoutTests/webgl/generate-webgl-tests.py	2021-01-26 00:33:44 UTC (rev 271867)
@@ -1,269 +0,0 @@
-# Copyright (C) 2013 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""generates webgl layout tests from the Khronos WebGL Conformance Tests"""
-
-# To use this, get a copy of the WebGL conformance tests then run this script
-# eg.
-#
-#   cd ~/temp
-#   git clone git://github.com/KhronosGroup/WebGL.git
-#   cd ~/WebKit/LayoutTests/webgl
-#   python generate-webgl-tests.py -w ~/temp/WebGL/sdk/tests -e
-#
-# Now check run the LayoutTests, update TestExpectations and check in the
-# result.
-
-import copy
-import os
-import os.path
-import sys
-import re
-import json
-import shutil
-from optparse import OptionParser
-
-if sys.version < '2.6':
-  print 'Wrong Python Version !!!: Need >= 2.6'
-  sys.exit(1)
-
-
-GLOBAL_OPTIONS = {
-  # version use. Tests at or below this will be included.
-  "version": "2.0.0",
-
-  # version used for unlabled tests
-  "default-version": "2.0",
-
-  # If set, the version we require. Tests below this will be ignored.
-  "min-version": "1.0.3",
-}
-
-
-def ReadFile(filename):
-  """Reads a file as a string"""
-  file = open(filename, "r")
-  data = ""
-  file.close()
-  return data
-
-
-def WriteFile(filename, data):
-  """Writes a string as a file"""
-  print "Writing: ", filename
-  dirname = os.path.dirname(filename)
-  if not os.path.exists(dirname):
-    os.makedirs(dirname)
-  file = open(filename, "wb")
-  file.write(data)
-  file.close()
-
-
-def CopyTree(src, dst, ignore=None):
-  """Recursively copy a directory tree"""
-  names = os.listdir(src)
-  if ignore is not None:
-    ignored_names = ignore(src, names)
-  else:
-    ignored_names = set()
-
-  if not os.path.exists(dst):
-    os.makedirs(dst)
-  errors = []
-  for name in names:
-    if name in ignored_names:
-      continue
-    srcname = os.path.join(src, name)
-    dstname = os.path.join(dst, name)
-    try:
-      if os.path.isdir(srcname):
-        CopyTree(srcname, dstname, ignore)
-      else:
-        # Will raise a SpecialFileError for unsupported file types
-        shutil.copyfile(srcname, dstname)
-    # catch the Error from the recursive copytree so that we can
-    # continue with other files
-    except Error, err:
-      errors.extend(err.args[0])
-    except EnvironmentError, why:
-      errors.append((srcname, dstname, str(why)))
-  if errors:
-    raise Error, errors
-
-
-def FileReader(filename):
-  """A File generator that returns only non empty, non comment lines"""
-  file = open(filename, "r")
-  lines = file.readlines()
-  file.close()
-  for line_number, line in enumerate(lines):
-    line = line.strip()
-    if (len(line) > 0 and
-        not line.startswith("#") and
-        not line.startswith(";") and
-        not line.startswith("//")):
-      yield line_number + 1, line
-
-
-def GreaterThanOrEqualToVersion(have, want):
-  """Compares to version strings"""
-  have = have.split(" ")[0].split(".")
-  want = want.split(" ")[0].split(".")
-  for ndx, want_str in enumerate(want):
-    want_num = int(want_str)
-    have_num = 0
-    if ndx < len(have):
-      have_num = int(have[ndx])
-    if have_num < want_num:
-      return False
-    if have_num >= want_num:
-      return True
-  return True
-
-
-def GetTestList(list_filename, dest_dir, hierarchical_options):
-  global GLOBAL_OPTIONS
-  tests = []
-  prefix = os.path.dirname(list_filename)
-  for line_number, line in FileReader(list_filename):
-    args = line.split()
-    test_options = {}
-    non_options = []
-    use_test = True
-    while len(args):
-      arg = args.pop(0)
-      if arg.startswith("-"):
-        if not arg.startswith("--"):
-          raise "%s:%d bad option" % (list_filename, line_number)
-        option = arg[2:]
-        if option == 'slow':
-          pass
-        elif option == 'min-version' or option == "max-version":
-          test_options[option] = args.pop(0)
-        else:
-          raise Exception("%s:%d unknown option '%s'" % (list_filename, line_number, arg))
-      else:
-        non_options.append(arg)
-    url = "" " ".join(non_options))
-
-    if not url.endswith(".txt"):
-      if "min-version" in test_options:
-        min_version = test_options["min-version"]
-      else:
-        min_version = hierarchical_options["default-version"]
-
-      if "min-version" in GLOBAL_OPTIONS:
-        use_test = GreaterThanOrEqualToVersion(min_version, GLOBAL_OPTIONS["min-version"])
-      else:
-        use_test = GreaterThanOrEqualToVersion(GLOBAL_OPTIONS["version"], min_version)
-
-    if not use_test:
-      continue
-
-    if url.endswith(".txt"):
-      if "min-version" in test_options:
-        hierarchical_options["default-version"] = test_options["min-version"]
-      tests = tests + GetTestList(
-          os.path.join(prefix, url), dest_dir, copy.copy(hierarchical_options))
-    else:
-      tests.append({"url": url})
-  return tests
-
-
-def main(argv):
-  """This is the main function."""
-  global GLOBAL_OPTIONS
-
-  parser = OptionParser()
-  parser.add_option(
-      "-v", "--verbose", action=""
-      help="prints more output.")
-  parser.add_option(
-      "-w", "--webgl-conformance-test", dest="source_dir",
-      help="path to webgl conformance tests. REQUIRED")
-  parser.add_option(
-      "-n", "--no-copy", action=""
-      help="do not copy tests")
-  parser.add_option(
-      "-e", "--generate-expectations", action=""
-      help="generatet the test expectations")
-  parser.add_option(
-      "-o", "--output-dir", dest="output_dir",
-      help="base directory for output. defaults to \'.\'",
-      default=".")
-
-  (options, args) = parser.parse_args(args=argv)
-
-  if not options.source_dir:
-    parser.print_help()
-    return 1
-
-  os.chdir(os.path.dirname(__file__) or '.')
-
-  source_dir = options.source_dir;
-  output_dir = options.output_dir;
-  webgl_tests_dir = os.path.join(output_dir, "resources/webgl_test_files")
-
-  # copy all the files from the WebGL conformance tests.
-  if not options.no_copy:
-    CopyTree(
-        source_dir, webgl_tests_dir, shutil.ignore_patterns(
-            '.git', '*.pyc', 'tmp*'))
-
-  test_template = ReadFile("resources/webgl-wrapper-template.html")
-  expectation_template = ReadFile("resources/webgl-expectation-template.txt")
-
-  # generate wrappers for all the tests
-  tests = GetTestList(os.path.join(source_dir, "00_test_list.txt"), ".",
-                      copy.copy(GLOBAL_OPTIONS))
-
-  for test in tests:
-    url = "" source_dir)
-    dst = os.path.join(output_dir, url)
-    dst_dir = os.path.dirname(dst)
-    src = "" url), dst_dir).replace("\\", "/")
-    base_url = os.path.relpath(output_dir, dst_dir).replace("\\", "/")
-    subs = {
-      "url": src,
-      "url_name": os.path.basename(url),
-      "base_url": base_url,
-    }
-    WriteFile(dst, test_template % subs)
-    if options.generate_expectations:
-      expectation_filename = os.path.splitext(dst)[0] + "-expected.txt"
-      WriteFile(expectation_filename, expectation_template % subs)
-
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
-
-
-
-
-

Modified: trunk/Tools/ChangeLog (271866 => 271867)


--- trunk/Tools/ChangeLog	2021-01-25 23:32:13 UTC (rev 271866)
+++ trunk/Tools/ChangeLog	2021-01-26 00:33:44 UTC (rev 271867)
@@ -1,3 +1,16 @@
+2021-01-25  Jonathan Bedard  <jbed...@apple.com>
+
+        [run-webkit-tests] Support python layout tests
+        https://bugs.webkit.org/show_bug.cgi?id=220749
+        <rdar://problem/73375271>
+
+        Reviewed by Alexey Proskuryakov.
+
+        * Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py:
+        (LayoutTestFinder._real_tests): Exclude "tools" directories.
+        (LayoutTestFinder._is_test_file): Special case for web socket's *_wsh.py files.
+        (LayoutTestFinder._is_w3c_resource_file): Exclude w3c Python files.
+
 2021-01-25  Ryan Haddad  <ryanhad...@apple.com>
 
         Unreviewed, reverting r271805.

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py (271866 => 271867)


--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py	2021-01-25 23:32:13 UTC (rev 271866)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py	2021-01-26 00:33:44 UTC (rev 271867)
@@ -40,7 +40,7 @@
 
 
 # When collecting test cases, we include any file with these extensions.
-_supported_test_extensions = set(['.html', '.shtml', '.xml', '.xhtml', '.pl', '.htm', '.php', '.svg', '.mht', '.xht'])
+_supported_test_extensions = set(['.html', '.shtml', '.xml', '.xhtml', '.pl', '.py', '.htm', '.php', '.svg', '.mht', '.xht'])
 
 
 # If any changes are made here be sure to update the isUsedInReftest method in old-run-webkit-tests as well.
@@ -107,7 +107,7 @@
 
     def _real_tests(self, paths):
         # When collecting test cases, skip these directories
-        skipped_directories = set(['.svn', '_svn', 'resources', 'support', 'script-tests', 'reference', 'reftest'])
+        skipped_directories = set(['.svn', '_svn', 'resources', 'support', 'script-tests', 'tools', 'reference', 'reftest'])
         files = find_files.find(self._port._filesystem, self._port.layout_tests_dir(), paths, skipped_directories, self._is_test_file, self._port.test_key)
         return [self._port.relative_test_filename(f) for f in files]
 
@@ -118,6 +118,9 @@
             return False
         if self._is_w3c_resource_file(filesystem, dirname, filename):
             return False
+        # Special case for websocket tooling
+        if filename.endswith('_wsh.py'):
+            return False
         return True
 
     def _is_w3c_resource_file(self, filesystem, dirname, filename):
@@ -131,6 +134,10 @@
             json_data = filesystem.read_text_file(filepath)
             self._w3c_resource_files = json.loads(json_data)
 
+        _, extension = filesystem.splitext(filename)
+        if extension == '.py':
+            return True
+
         subpath = path[len(w3c_path) + 1:].replace('\\', '/')
         if subpath in self._w3c_resource_files["files"]:
             return True
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to