Title: [254383] trunk
Revision
254383
Author
[email protected]
Date
2020-01-10 17:06:40 -0800 (Fri, 10 Jan 2020)

Log Message

Python3: Support Source/WebKit/Scripts/webkit
https://bugs.webkit.org/show_bug.cgi?id=206078

Reviewed by Stephanie Lewis.

Source/WebKit:

Covered by existing unit tests.

* Scripts/webkit/LegacyMessages-expected.h: Sort forward declarations.
* Scripts/webkit/Messages-expected.h: Ditto.
* Scripts/webkit/messages.py: Sort printed outputs.

Tools:

* Scripts/test-webkitpy-python3: Call test-webkitpy with Python 3 since
everything is now compatible.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (254382 => 254383)


--- trunk/Source/WebKit/ChangeLog	2020-01-11 00:48:21 UTC (rev 254382)
+++ trunk/Source/WebKit/ChangeLog	2020-01-11 01:06:40 UTC (rev 254383)
@@ -1,3 +1,16 @@
+2020-01-10  Jonathan Bedard  <[email protected]>
+
+        Python3: Support Source/WebKit/Scripts/webkit
+        https://bugs.webkit.org/show_bug.cgi?id=206078
+
+        Reviewed by Stephanie Lewis.
+
+        Covered by existing unit tests.
+
+        * Scripts/webkit/LegacyMessages-expected.h: Sort forward declarations.
+        * Scripts/webkit/Messages-expected.h: Ditto.
+        * Scripts/webkit/messages.py: Sort printed outputs.
+
 2020-01-10  Brent Fulgham  <[email protected]>
 
         [iOS] Remove reporting for some well-understood sandbox rules

Modified: trunk/Source/WebKit/Scripts/webkit/LegacyMessages-expected.h (254382 => 254383)


--- trunk/Source/WebKit/Scripts/webkit/LegacyMessages-expected.h	2020-01-11 00:48:21 UTC (rev 254382)
+++ trunk/Source/WebKit/Scripts/webkit/LegacyMessages-expected.h	2020-01-11 01:06:40 UTC (rev 254383)
@@ -41,13 +41,13 @@
 #include <wtf/text/WTFString.h>
 
 namespace IPC {
+class DummyType;
 class MachPort;
-class DummyType;
 }
 
 namespace WebKit {
+class WebPreferencesStore;
 class WebTouchEvent;
-class WebPreferencesStore;
 }
 
 namespace Messages {

Modified: trunk/Source/WebKit/Scripts/webkit/Messages-expected.h (254382 => 254383)


--- trunk/Source/WebKit/Scripts/webkit/Messages-expected.h	2020-01-11 00:48:21 UTC (rev 254382)
+++ trunk/Source/WebKit/Scripts/webkit/Messages-expected.h	2020-01-11 01:06:40 UTC (rev 254383)
@@ -41,13 +41,13 @@
 #include <wtf/text/WTFString.h>
 
 namespace IPC {
+class DummyType;
 class MachPort;
-class DummyType;
 }
 
 namespace WebKit {
+class WebPreferencesStore;
 class WebTouchEvent;
-class WebPreferencesStore;
 }
 
 namespace Messages {

Modified: trunk/Source/WebKit/Scripts/webkit/messages.py (254382 => 254383)


--- trunk/Source/WebKit/Scripts/webkit/messages.py	2020-01-11 00:48:21 UTC (rev 254382)
+++ trunk/Source/WebKit/Scripts/webkit/messages.py	2020-01-11 01:06:40 UTC (rev 254383)
@@ -195,7 +195,7 @@
 def forward_declarations_for_namespace(namespace, kind_and_types):
     result = []
     result.append('namespace %s {\n' % namespace)
-    result += ['%s;\n' % forward_declaration(namespace, x) for x in kind_and_types]
+    result += ['%s;\n' % forward_declaration(namespace, x) for x in sorted(kind_and_types)]
     result.append('}\n')
     return ''.join(result)
 
@@ -290,7 +290,7 @@
     for header in sorted(headers):
         conditions = conditions_for_header(header)
         if conditions and not None in conditions:
-            header_include = '#if %s\n' % ' || '.join(set(conditions))
+            header_include = '#if %s\n' % ' || '.join(sorted(set(conditions)))
             header_include += '#include %s\n' % header
             header_include += '#endif\n'
             header_includes.append(header_include)
@@ -347,7 +347,7 @@
     for header in sorted(headers):
         conditions = conditions_for_header(header)
         if conditions and not None in conditions:
-            header_include = '#if %s\n' % ' || '.join(set(conditions))
+            header_include = '#if %s\n' % ' || '.join(sorted(set(conditions)))
             header_include += '#include %s\n' % header
             header_include += '#endif\n'
             header_includes.append(header_include)
@@ -702,7 +702,7 @@
     result.append('#include "%s.h"\n\n' % receiver.name)
     for header in sorted(header_conditions):
         if header_conditions[header] and not None in header_conditions[header]:
-            result.append('#if %s\n' % ' || '.join(set(header_conditions[header])))
+            result.append('#if %s\n' % ' || '.join(sorted(set(header_conditions[header]))))
             result += ['#include %s\n' % header]
             result.append('#endif\n')
         else:

Modified: trunk/Tools/ChangeLog (254382 => 254383)


--- trunk/Tools/ChangeLog	2020-01-11 00:48:21 UTC (rev 254382)
+++ trunk/Tools/ChangeLog	2020-01-11 01:06:40 UTC (rev 254383)
@@ -1,5 +1,15 @@
 2020-01-10  Jonathan Bedard  <[email protected]>
 
+        Python3: Support Source/WebKit/Scripts/webkit
+        https://bugs.webkit.org/show_bug.cgi?id=206078
+
+        Reviewed by Stephanie Lewis.
+
+        * Scripts/test-webkitpy-python3: Call test-webkitpy with Python 3 since
+        everything is now compatible.
+
+2020-01-10  Jonathan Bedard  <[email protected]>
+
         webkit-patch crashes when creating new bug with Python 3
         https://bugs.webkit.org/show_bug.cgi?id=205911
 

Modified: trunk/Tools/Scripts/test-webkitpy-python3 (254382 => 254383)


--- trunk/Tools/Scripts/test-webkitpy-python3	2020-01-11 00:48:21 UTC (rev 254382)
+++ trunk/Tools/Scripts/test-webkitpy-python3	2020-01-11 01:06:40 UTC (rev 254383)
@@ -21,94 +21,6 @@
 # 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.
 
+from webkitpy.common import multiprocessing_bootstrap
 
-import sys
-sys.dont_write_bytecode = True
-
-import argparse
-import os
-import sys
-import unittest
-
-from webkitpy.common.checkout.scm.scm_unittest import SCMTest
-
-
-PYTHON3_COMPATIBLE_DIRECTORIES = [
-  'webkitpy.benchmark_runner',
-  'webkitpy.browserperfdash',
-  'webkitpy.common',
-  'webkitpy.layout_tests',
-  'webkitpy.performance_tests',
-  'webkitpy.port',
-  'webkitpy.results',
-  'webkitpy.style',
-  'webkitpy.test',
-  'webkitpy.tool',
-  'webkitpy.w3c',
-  'webkitpy.xcode',
-]
-SLOW_TESTS = [
-    SCMTest,
-]
-
-def is_slow(candidate):
-    if isinstance(candidate, unittest.suite.TestSuite):
-        return any(is_slow(test) for test in candidate)
-    for test in SLOW_TESTS:
-        if isinstance(candidate, test):
-            return True
-    return False
-
-
-def main():
-    parser = argparse.ArgumentParser(description='Run unit tests with Python3. This is intended as a temporary script during the Python2/3 transition')
-    parser.add_argument(
-        '-v', '--verbose',
-        default=False, action='',
-        help='Verbose output',
-    )
-    parser.add_argument(
-        '-f', '--stop-on-fail',
-        default=False, action='',
-        help='Stop on first fail or error',
-    )
-    parser.add_argument(
-        '-a', '--all',
-        default=False, action='',
-        help='Enables SCM tests, which are slow and so disable by default',
-    )
-
-    if len(PYTHON3_COMPATIBLE_DIRECTORIES) == 1:
-        compatible_directories_readable = PYTHON3_COMPATIBLE_DIRECTORIES[0]
-    else:
-        compatible_directories_readable = '{} and {}'.format(
-            ', '.join(PYTHON3_COMPATIBLE_DIRECTORIES[:-1]),
-            PYTHON3_COMPATIBLE_DIRECTORIES[-1],
-        )
-    parser.add_argument(
-        'modules_to_test', nargs='*',
-        help='Modules to be tested. By default, this is {}'.format(compatible_directories_readable),
-        default=PYTHON3_COMPATIBLE_DIRECTORIES,
-    )
-    options = parser.parse_args()
-
-    root = os.path.dirname(os.path.abspath(__file__))
-
-    suite = unittest.TestSuite()
-    for module_name in options.modules_to_test:
-        module_suite = unittest.defaultTestLoader.discover(os.path.join(root, module_name.replace('.', '/')), pattern='*test.py', top_level_dir=root)
-        for test in (module_suite or []):
-            if options.all or not is_slow(test):
-                suite.addTest(test)
-
-    if suite.countTestCases() == 0:
-        raise RuntimeError('No matching tests found.')
-
-    from webkitpy.thirdparty import autoinstall_everything
-    autoinstall_everything()
-
-    result = unittest.TextTestRunner(verbosity=int(options.verbose) + 1, failfast=options.stop_on_fail, buffer=not options.verbose).run(suite)
-    return len(result.errors)
-
-if __name__ == '__main__':
-    sys.exit(main())
+multiprocessing_bootstrap.run('webkitpy', 'test', 'main.py')
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to