REGRESSION(r155373): Mac WK2 EWS bots is actually Mac WK1 debug
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Oct 2013 21:25:19 +0000 (21:25 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Oct 2013 21:25:19 +0000 (21:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=123064

Reviewed by Ryosuke Niwa.

Revert r155373 as it is causing incorrect port/platform deduction for the Mac EWS systems.

* Scripts/webkitpy/common/config/ports.py: Added.
(DeprecatedPort):
(DeprecatedPort.name):
(DeprecatedPort.flag):
(DeprecatedPort.script_path):
(DeprecatedPort.script_shell_command):
(DeprecatedPort.port):
(DeprecatedPort.makeArgs):
(DeprecatedPort.update_webkit_command):
(DeprecatedPort.check_webkit_style_command):
(DeprecatedPort.prepare_changelog_command):
(DeprecatedPort.build_webkit_command):
(DeprecatedPort.run_javascriptcore_tests_command):
(DeprecatedPort.run_webkit_unit_tests_command):
(DeprecatedPort.run_webkit_tests_command):
(DeprecatedPort.run_python_unittests_command):
(DeprecatedPort.run_perl_unittests_command):
(DeprecatedPort.run_bindings_tests_command):
(MacPort):
(MacWK2Port):
(MacWK2Port.run_webkit_tests_command):
(WinPort):
(WinPort.run_bindings_tests_command):
(GtkPort):
(GtkPort.build_webkit_command):
(GtkPort.run_webkit_tests_command):
(GtkWK2Port):
(GtkWK2Port.build_webkit_command):
(GtkWK2Port.run_webkit_tests_command):
(QtPort):
(QtPort.build_webkit_command):
(QtPort.run_webkit_tests_command):
(QtWK2Port):
(QtWK2Port.build_webkit_command):
(QtWK2Port.run_webkit_tests_command):
(EflPort):
(EflPort.build_webkit_command):
(EflWK2Port):
(EflWK2Port.build_webkit_command):
* Scripts/webkitpy/common/config/ports_mock.py: Added.
(MockPort):
(MockPort.name):
(MockPort.check_webkit_style_command):
(MockPort.update_webkit_command):
(MockPort.build_webkit_command):
(MockPort.prepare_changelog_command):
(MockPort.run_python_unittests_command):
(MockPort.run_perl_unittests_command):
(MockPort.run_javascriptcore_tests_command):
(MockPort.run_webkit_unit_tests_command):
(MockPort.run_webkit_tests_command):
(MockPort.run_bindings_tests_command):
* Scripts/webkitpy/common/config/ports_unittest.py: Added.
(DeprecatedPortTest):
(DeprecatedPortTest.test_mac_port):
(DeprecatedPortTest.test_gtk_port):
(DeprecatedPortTest.test_gtk_wk2_port):
(DeprecatedPortTest.test_efl_port):
(DeprecatedPortTest.test_qt_port):
(DeprecatedPortTest.test_qt_wk2_port):
* Scripts/webkitpy/port/base.py:
(Port._port_flag_for_scripts):
(Port._wk2_port_name):
* Scripts/webkitpy/port/base_unittest.py:
(PortTest.test_build_path):
* Scripts/webkitpy/port/efl_unittest.py:
(EflPortTest.test_show_results_html_file):
* Scripts/webkitpy/port/gtk_unittest.py:
(GtkPortTest.test_get_crash_log):
* Scripts/webkitpy/port/mac_unittest.py:
(test_64bit):
* Scripts/webkitpy/port/test.py:
(TestPort.virtual_test_suites):
* Scripts/webkitpy/tool/bot/flakytestreporter.py:
(FlakyTestReporter.__init__):
* Scripts/webkitpy/tool/bot/irc_command.py:
(Rollout._update_working_copy):
* Scripts/webkitpy/tool/commands/download_unittest.py:
* Scripts/webkitpy/tool/commands/earlywarningsystem.py:
(AbstractEarlyWarningSystem.run_command):
* Scripts/webkitpy/tool/commands/queues.py:
(PatchProcessingQueue.begin_work_queue):
(CommitQueue.run_command):
* Scripts/webkitpy/tool/main.py:
(WebKitPatch.__init__):
(WebKitPatch.deprecated_port):
(WebKitPatch.handle_global_options):
* Scripts/webkitpy/tool/mocktool.py:
(MockTool.__init__):
(MockTool.deprecated_port):
* Scripts/webkitpy/tool/steps/build.py:
(Build.build):
* Scripts/webkitpy/tool/steps/checkstyle.py:
(CheckStyle.run):
* Scripts/webkitpy/tool/steps/commit.py:
(Commit._check_test_expectations):
* Scripts/webkitpy/tool/steps/preparechangelog.py:
(PrepareChangeLog.run):
* Scripts/webkitpy/tool/steps/preparechangelogforrevert.py:
(PrepareChangeLogForRevert.run):
* Scripts/webkitpy/tool/steps/runtests.py:
(RunTests.run):
* Scripts/webkitpy/tool/steps/runtests_unittest.py:
(RunTestsTest.test_webkit_run_unit_tests):
* Scripts/webkitpy/tool/steps/steps_unittest.py:
(StepsTest.test_runtests_args):
* Scripts/webkitpy/tool/steps/update.py:
(Update._update_command):
* Scripts/webkitpy/tool/steps/update_unittest.py:
(UpdateTest.test_update_command_non_interactive):
(UpdateTest.test_update_command_interactive):

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

27 files changed:
Tools/ChangeLog
Tools/Scripts/webkitpy/common/config/ports.py [new file with mode: 0644]
Tools/Scripts/webkitpy/common/config/ports_mock.py [new file with mode: 0644]
Tools/Scripts/webkitpy/common/config/ports_unittest.py [new file with mode: 0644]
Tools/Scripts/webkitpy/port/base.py
Tools/Scripts/webkitpy/port/base_unittest.py
Tools/Scripts/webkitpy/port/efl_unittest.py
Tools/Scripts/webkitpy/port/gtk_unittest.py
Tools/Scripts/webkitpy/port/mac_unittest.py
Tools/Scripts/webkitpy/port/test.py
Tools/Scripts/webkitpy/tool/bot/flakytestreporter.py
Tools/Scripts/webkitpy/tool/bot/irc_command.py
Tools/Scripts/webkitpy/tool/commands/download_unittest.py
Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py
Tools/Scripts/webkitpy/tool/commands/queues.py
Tools/Scripts/webkitpy/tool/main.py
Tools/Scripts/webkitpy/tool/mocktool.py
Tools/Scripts/webkitpy/tool/steps/build.py
Tools/Scripts/webkitpy/tool/steps/checkstyle.py
Tools/Scripts/webkitpy/tool/steps/commit.py
Tools/Scripts/webkitpy/tool/steps/preparechangelog.py
Tools/Scripts/webkitpy/tool/steps/preparechangelogforrevert.py
Tools/Scripts/webkitpy/tool/steps/runtests.py
Tools/Scripts/webkitpy/tool/steps/runtests_unittest.py
Tools/Scripts/webkitpy/tool/steps/steps_unittest.py
Tools/Scripts/webkitpy/tool/steps/update.py
Tools/Scripts/webkitpy/tool/steps/update_unittest.py

index f50ae1d..7250448 100644 (file)
@@ -1,3 +1,124 @@
+2013-10-19  Zan Dobersek  <zdobersek@igalia.com>
+
+        REGRESSION(r155373): Mac WK2 EWS bots is actually Mac WK1 debug
+        https://bugs.webkit.org/show_bug.cgi?id=123064
+
+        Reviewed by Ryosuke Niwa.
+
+        Revert r155373 as it is causing incorrect port/platform deduction for the Mac EWS systems.
+
+        * Scripts/webkitpy/common/config/ports.py: Added.
+        (DeprecatedPort):
+        (DeprecatedPort.name):
+        (DeprecatedPort.flag):
+        (DeprecatedPort.script_path):
+        (DeprecatedPort.script_shell_command):
+        (DeprecatedPort.port):
+        (DeprecatedPort.makeArgs):
+        (DeprecatedPort.update_webkit_command):
+        (DeprecatedPort.check_webkit_style_command):
+        (DeprecatedPort.prepare_changelog_command):
+        (DeprecatedPort.build_webkit_command):
+        (DeprecatedPort.run_javascriptcore_tests_command):
+        (DeprecatedPort.run_webkit_unit_tests_command):
+        (DeprecatedPort.run_webkit_tests_command):
+        (DeprecatedPort.run_python_unittests_command):
+        (DeprecatedPort.run_perl_unittests_command):
+        (DeprecatedPort.run_bindings_tests_command):
+        (MacPort):
+        (MacWK2Port):
+        (MacWK2Port.run_webkit_tests_command):
+        (WinPort):
+        (WinPort.run_bindings_tests_command):
+        (GtkPort):
+        (GtkPort.build_webkit_command):
+        (GtkPort.run_webkit_tests_command):
+        (GtkWK2Port):
+        (GtkWK2Port.build_webkit_command):
+        (GtkWK2Port.run_webkit_tests_command):
+        (QtPort):
+        (QtPort.build_webkit_command):
+        (QtPort.run_webkit_tests_command):
+        (QtWK2Port):
+        (QtWK2Port.build_webkit_command):
+        (QtWK2Port.run_webkit_tests_command):
+        (EflPort):
+        (EflPort.build_webkit_command):
+        (EflWK2Port):
+        (EflWK2Port.build_webkit_command):
+        * Scripts/webkitpy/common/config/ports_mock.py: Added.
+        (MockPort):
+        (MockPort.name):
+        (MockPort.check_webkit_style_command):
+        (MockPort.update_webkit_command):
+        (MockPort.build_webkit_command):
+        (MockPort.prepare_changelog_command):
+        (MockPort.run_python_unittests_command):
+        (MockPort.run_perl_unittests_command):
+        (MockPort.run_javascriptcore_tests_command):
+        (MockPort.run_webkit_unit_tests_command):
+        (MockPort.run_webkit_tests_command):
+        (MockPort.run_bindings_tests_command):
+        * Scripts/webkitpy/common/config/ports_unittest.py: Added.
+        (DeprecatedPortTest):
+        (DeprecatedPortTest.test_mac_port):
+        (DeprecatedPortTest.test_gtk_port):
+        (DeprecatedPortTest.test_gtk_wk2_port):
+        (DeprecatedPortTest.test_efl_port):
+        (DeprecatedPortTest.test_qt_port):
+        (DeprecatedPortTest.test_qt_wk2_port):
+        * Scripts/webkitpy/port/base.py:
+        (Port._port_flag_for_scripts):
+        (Port._wk2_port_name):
+        * Scripts/webkitpy/port/base_unittest.py:
+        (PortTest.test_build_path):
+        * Scripts/webkitpy/port/efl_unittest.py:
+        (EflPortTest.test_show_results_html_file):
+        * Scripts/webkitpy/port/gtk_unittest.py:
+        (GtkPortTest.test_get_crash_log):
+        * Scripts/webkitpy/port/mac_unittest.py:
+        (test_64bit):
+        * Scripts/webkitpy/port/test.py:
+        (TestPort.virtual_test_suites):
+        * Scripts/webkitpy/tool/bot/flakytestreporter.py:
+        (FlakyTestReporter.__init__):
+        * Scripts/webkitpy/tool/bot/irc_command.py:
+        (Rollout._update_working_copy):
+        * Scripts/webkitpy/tool/commands/download_unittest.py:
+        * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+        (AbstractEarlyWarningSystem.run_command):
+        * Scripts/webkitpy/tool/commands/queues.py:
+        (PatchProcessingQueue.begin_work_queue):
+        (CommitQueue.run_command):
+        * Scripts/webkitpy/tool/main.py:
+        (WebKitPatch.__init__):
+        (WebKitPatch.deprecated_port):
+        (WebKitPatch.handle_global_options):
+        * Scripts/webkitpy/tool/mocktool.py:
+        (MockTool.__init__):
+        (MockTool.deprecated_port):
+        * Scripts/webkitpy/tool/steps/build.py:
+        (Build.build):
+        * Scripts/webkitpy/tool/steps/checkstyle.py:
+        (CheckStyle.run):
+        * Scripts/webkitpy/tool/steps/commit.py:
+        (Commit._check_test_expectations):
+        * Scripts/webkitpy/tool/steps/preparechangelog.py:
+        (PrepareChangeLog.run):
+        * Scripts/webkitpy/tool/steps/preparechangelogforrevert.py:
+        (PrepareChangeLogForRevert.run):
+        * Scripts/webkitpy/tool/steps/runtests.py:
+        (RunTests.run):
+        * Scripts/webkitpy/tool/steps/runtests_unittest.py:
+        (RunTestsTest.test_webkit_run_unit_tests):
+        * Scripts/webkitpy/tool/steps/steps_unittest.py:
+        (StepsTest.test_runtests_args):
+        * Scripts/webkitpy/tool/steps/update.py:
+        (Update._update_command):
+        * Scripts/webkitpy/tool/steps/update_unittest.py:
+        (UpdateTest.test_update_command_non_interactive):
+        (UpdateTest.test_update_command_interactive):
+
 2013-10-19  Andreas Kling  <akling@apple.com>
 
         RefPtr::releaseNonNull() incorrectly increments the refcount.
diff --git a/Tools/Scripts/webkitpy/common/config/ports.py b/Tools/Scripts/webkitpy/common/config/ports.py
new file mode 100644 (file)
index 0000000..0c20dae
--- /dev/null
@@ -0,0 +1,232 @@
+# Copyright (C) 2009, 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.
+#
+# WebKit's Python module for understanding the various ports
+
+import os
+import platform
+import sys
+
+from webkitpy.common.system.executive import Executive
+
+
+class DeprecatedPort(object):
+    results_directory = "/tmp/layout-test-results"
+
+    # Subclasses must override
+    port_flag_name = None
+
+    # FIXME: This is only used by BotInfo.
+    def name(self):
+        return self.__class__
+
+    def flag(self):
+        if self.port_flag_name:
+            return "--port=%s" % self.port_flag_name
+        return None
+
+    # We might need to pass scm into this function for scm.checkout_root
+    def script_path(self, script_name):
+        return os.path.join("Tools", "Scripts", script_name)
+
+    def script_shell_command(self, script_name):
+        script_path = self.script_path(script_name)
+        return Executive.shell_command_for_script(script_path)
+
+    @staticmethod
+    def port(port_name):
+        ports = {
+            "gtk": GtkPort,
+            "gtk-wk2": GtkWK2Port,
+            "mac": MacPort,
+            "mac-wk2": MacWK2Port,
+            "win": WinPort,
+            "qt": QtPort,
+            "qt-wk2": QtWK2Port,
+            "efl": EflPort,
+            "efl-wk2": EflWK2Port,
+        }
+        default_port = {
+            "Windows": WinPort,
+            "Darwin": MacPort,
+        }
+        # Do we really need MacPort as the ultimate default?
+        return ports.get(port_name, default_port.get(platform.system(), MacPort))()
+
+    def makeArgs(self):
+        # FIXME: This shouldn't use a static Executive().
+        args = '--makeargs="-j%s"' % Executive().cpu_count()
+        if os.environ.has_key('MAKEFLAGS'):
+            args = '--makeargs="%s"' % os.environ['MAKEFLAGS']
+        return args
+
+    def update_webkit_command(self, non_interactive=False):
+        return self.script_shell_command("update-webkit")
+
+    def check_webkit_style_command(self):
+        return self.script_shell_command("check-webkit-style")
+
+    def prepare_changelog_command(self):
+        return self.script_shell_command("prepare-ChangeLog")
+
+    def build_webkit_command(self, build_style=None):
+        command = self.script_shell_command("build-webkit")
+        if build_style == "debug":
+            command.append("--debug")
+        if build_style == "release":
+            command.append("--release")
+        return command
+
+    def run_javascriptcore_tests_command(self):
+        return self.script_shell_command("run-javascriptcore-tests")
+
+    def run_webkit_unit_tests_command(self):
+        return None
+
+    def run_webkit_tests_command(self):
+        return self.script_shell_command("run-webkit-tests")
+
+    def run_python_unittests_command(self):
+        return self.script_shell_command("test-webkitpy")
+
+    def run_perl_unittests_command(self):
+        return self.script_shell_command("test-webkitperl")
+
+    def run_bindings_tests_command(self):
+        return self.script_shell_command("run-bindings-tests")
+
+
+class MacPort(DeprecatedPort):
+    port_flag_name = "mac"
+
+
+class MacWK2Port(DeprecatedPort):
+    port_flag_name = "mac-wk2"
+
+    def run_webkit_tests_command(self):
+        command = super(MacWK2Port, self).run_webkit_tests_command()
+        command.append("-2")
+        return command
+
+
+class WinPort(DeprecatedPort):
+    port_flag_name = "win"
+
+    def run_bindings_tests_command(self):
+        return None
+
+
+class GtkPort(DeprecatedPort):
+    port_flag_name = "gtk"
+
+    def build_webkit_command(self, build_style=None):
+        command = super(GtkPort, self).build_webkit_command(build_style=build_style)
+        command.append("--gtk")
+        command.append("--update-gtk")
+        command.append("--no-webkit2")
+        command.append(super(GtkPort, self).makeArgs())
+        return command
+
+    def run_webkit_tests_command(self):
+        command = super(GtkPort, self).run_webkit_tests_command()
+        command.append("--gtk")
+        return command
+
+
+class GtkWK2Port(DeprecatedPort):
+    port_flag_name = "gtk-wk2"
+
+    def build_webkit_command(self, build_style=None):
+        command = super(GtkWK2Port, self).build_webkit_command(build_style=build_style)
+        command.append("--gtk")
+        command.append("--update-gtk")
+        command.append("--no-webkit1")
+        command.append(super(GtkWK2Port, self).makeArgs())
+        return command
+
+    def run_webkit_tests_command(self):
+        command = super(GtkWK2Port, self).run_webkit_tests_command()
+        command.append("--gtk")
+        command.append("-2")
+        return command
+
+
+class QtPort(DeprecatedPort):
+    port_flag_name = "qt"
+
+    def build_webkit_command(self, build_style=None):
+        command = super(QtPort, self).build_webkit_command(build_style=build_style)
+        command.append("--qt")
+        command.append("--no-webkit2")
+        command.append(super(QtPort, self).makeArgs())
+        return command
+
+    def run_webkit_tests_command(self):
+        command = super(QtPort, self).run_webkit_tests_command()
+        command.append("--qt")
+        return command
+
+
+class QtWK2Port(DeprecatedPort):
+    port_flag_name = "qt-wk2"
+
+    def build_webkit_command(self, build_style=None):
+        command = super(QtWK2Port, self).build_webkit_command(build_style=build_style)
+        command.append("--qt")
+        command.append(super(QtWK2Port, self).makeArgs())
+        return command
+
+    def run_webkit_tests_command(self):
+        command = super(QtWK2Port, self).run_webkit_tests_command()
+        command.append("--qt")
+        command.append("-2")
+        return command
+
+
+class EflPort(DeprecatedPort):
+    port_flag_name = "efl"
+
+    def build_webkit_command(self, build_style=None):
+        command = super(EflPort, self).build_webkit_command(build_style=build_style)
+        command.append("--efl")
+        command.append("--update-efl")
+        command.append("--no-webkit2")
+        command.append(super(EflPort, self).makeArgs())
+        return command
+
+
+class EflWK2Port(DeprecatedPort):
+    port_flag_name = "efl-wk2"
+
+    def build_webkit_command(self, build_style=None):
+        command = super(EflWK2Port, self).build_webkit_command(build_style=build_style)
+        command.append("--efl")
+        command.append("--update-efl")
+        command.append("--no-webkit1")
+        command.append(super(EflWK2Port, self).makeArgs())
+        return command
diff --git a/Tools/Scripts/webkitpy/common/config/ports_mock.py b/Tools/Scripts/webkitpy/common/config/ports_mock.py
new file mode 100644 (file)
index 0000000..779796c
--- /dev/null
@@ -0,0 +1,62 @@
+# Copyright (C) 2011 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.
+
+
+class MockPort(object):
+    def name(self):
+        return "MockPort"
+
+    def check_webkit_style_command(self):
+        return ["mock-check-webkit-style"]
+
+    def update_webkit_command(self, non_interactive=False):
+        return ["mock-update-webkit"]
+
+    def build_webkit_command(self, build_style=None):
+        return ["mock-build-webkit"]
+
+    def prepare_changelog_command(self):
+        return ['mock-prepare-ChangeLog']
+
+    def run_python_unittests_command(self):
+        return ['mock-test-webkitpy']
+
+    def run_perl_unittests_command(self):
+        return ['mock-test-webkitperl']
+
+    def run_javascriptcore_tests_command(self):
+        return ['mock-run-javacriptcore-tests']
+
+    def run_webkit_unit_tests_command(self):
+        return ['mock-run-webkit-unit-tests']
+
+    def run_webkit_tests_command(self):
+        return ['mock-run-webkit-tests']
+
+    def run_bindings_tests_command(self):
+        return ['mock-run-bindings-tests']
diff --git a/Tools/Scripts/webkitpy/common/config/ports_unittest.py b/Tools/Scripts/webkitpy/common/config/ports_unittest.py
new file mode 100644 (file)
index 0000000..daca54a
--- /dev/null
@@ -0,0 +1,69 @@
+# Copyright (c) 2009, 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.
+
+import unittest2 as unittest
+
+from webkitpy.common.config.ports import *
+
+
+class DeprecatedPortTest(unittest.TestCase):
+    def test_mac_port(self):
+        self.assertEqual(MacPort().flag(), "--port=mac")
+        self.assertEqual(MacPort().run_webkit_tests_command(), DeprecatedPort().script_shell_command("run-webkit-tests"))
+        self.assertEqual(MacPort().build_webkit_command(), DeprecatedPort().script_shell_command("build-webkit"))
+        self.assertEqual(MacPort().build_webkit_command(build_style="debug"), DeprecatedPort().script_shell_command("build-webkit") + ["--debug"])
+        self.assertEqual(MacPort().build_webkit_command(build_style="release"), DeprecatedPort().script_shell_command("build-webkit") + ["--release"])
+
+    def test_gtk_port(self):
+        self.assertEqual(GtkPort().flag(), "--port=gtk")
+        self.assertEqual(GtkPort().run_webkit_tests_command(), DeprecatedPort().script_shell_command("run-webkit-tests") + ["--gtk"])
+        self.assertEqual(GtkPort().build_webkit_command(), DeprecatedPort().script_shell_command("build-webkit") + ["--gtk", "--update-gtk", "--no-webkit2", DeprecatedPort().makeArgs()])
+        self.assertEqual(GtkPort().build_webkit_command(build_style="debug"), DeprecatedPort().script_shell_command("build-webkit") + ["--debug", "--gtk", "--update-gtk", "--no-webkit2", DeprecatedPort().makeArgs()])
+
+    def test_gtk_wk2_port(self):
+        self.assertEqual(GtkWK2Port().flag(), "--port=gtk-wk2")
+        self.assertEqual(GtkWK2Port().run_webkit_tests_command(), DeprecatedPort().script_shell_command("run-webkit-tests") + ["--gtk", "-2"])
+        self.assertEqual(GtkWK2Port().build_webkit_command(), DeprecatedPort().script_shell_command("build-webkit") + ["--gtk", "--update-gtk", "--no-webkit1", DeprecatedPort().makeArgs()])
+        self.assertEqual(GtkWK2Port().build_webkit_command(build_style="debug"), DeprecatedPort().script_shell_command("build-webkit") + ["--debug", "--gtk", "--update-gtk", "--no-webkit1", DeprecatedPort().makeArgs()])
+
+    def test_efl_port(self):
+        self.assertEqual(EflPort().flag(), "--port=efl")
+        self.assertEqual(EflPort().build_webkit_command(), DeprecatedPort().script_shell_command("build-webkit") + ["--efl", "--update-efl", "--no-webkit2", DeprecatedPort().makeArgs()])
+        self.assertEqual(EflPort().build_webkit_command(build_style="debug"), DeprecatedPort().script_shell_command("build-webkit") + ["--debug", "--efl", "--update-efl", "--no-webkit2", DeprecatedPort().makeArgs()])
+
+    def test_qt_port(self):
+        self.assertEqual(QtPort().flag(), "--port=qt")
+        self.assertEqual(QtPort().run_webkit_tests_command(), DeprecatedPort().script_shell_command("run-webkit-tests") + ["--qt"])
+        self.assertEqual(QtPort().build_webkit_command(), DeprecatedPort().script_shell_command("build-webkit") + ["--qt", "--no-webkit2", DeprecatedPort().makeArgs()])
+        self.assertEqual(QtPort().build_webkit_command(build_style="debug"), DeprecatedPort().script_shell_command("build-webkit") + ["--debug", "--qt", "--no-webkit2", DeprecatedPort().makeArgs()])
+
+    def test_qt_wk2_port(self):
+        self.assertEqual(QtWK2Port().flag(), "--port=qt-wk2")
+        self.assertEqual(QtWK2Port().run_webkit_tests_command(), DeprecatedPort().script_shell_command("run-webkit-tests") + ["--qt", "-2"])
+        self.assertEqual(QtWK2Port().build_webkit_command(), DeprecatedPort().script_shell_command("build-webkit") + ["--qt", DeprecatedPort().makeArgs()])
+        self.assertEqual(QtWK2Port().build_webkit_command(build_style="debug"), DeprecatedPort().script_shell_command("build-webkit") + ["--debug", "--qt", DeprecatedPort().makeArgs()])
index 6b44fbc..7abd3e0 100644 (file)
@@ -52,7 +52,7 @@ from webkitpy.common import find_files
 from webkitpy.common import read_checksum_from_png
 from webkitpy.common.memoized import memoized
 from webkitpy.common.system import path
-from webkitpy.common.system.executive import Executive, ScriptError
+from webkitpy.common.system.executive import ScriptError
 from webkitpy.common.system.systemhost import SystemHost
 from webkitpy.common.webkit_finder import WebKitFinder
 from webkitpy.layout_tests.models.test_configuration import TestConfiguration
@@ -1413,9 +1413,6 @@ class Port(object):
         # This is overrriden by ports which need a flag passed to scripts to distinguish the use of that port.
         return None
 
-    def tooling_flag(self):
-        return "--port=%s%s" % (self.port_name, '-wk2' if self.get_option('webkit_test_runner') else '')
-
     # This is modeled after webkitdirs.pm argumentsForConfiguration() from old-run-webkit-tests
     def _arguments_for_configuration(self):
         config_args = []
@@ -1538,53 +1535,6 @@ class Port(object):
         # By current convention, the WebKit2 name is always mac-wk2, win-wk2, not mac-leopard-wk2, etc,
         return "%s-wk2" % self.port_name
 
-    # We might need to pass scm into this function for scm.checkout_root
-    @staticmethod
-    def script_shell_command(script_name):
-        script_path = os.path.join("Tools", "Scripts", script_name)
-        return Executive.shell_command_for_script(script_path)
-
-    def make_args(self):
-        args = "--makeargs=\"-j%s\"" % self._executive.cpu_count()
-        if "MAKEFLAGS" in os.environ:
-            args = "--makeargs=\"%s\"" % os.environ["MAKEFLAGS"]
-        return args
-
-    def update_webkit_command(self, non_interactive=False):
-        return self.script_shell_command("update-webkit")
-
-    def check_webkit_style_command(self):
-        return self.script_shell_command("check-webkit-style")
-
-    def prepare_changelog_command(self):
-        return self.script_shell_command("prepare-ChangeLog")
-
-    def build_webkit_command(self, build_style=None):
-        command = self.script_shell_command("build-webkit")
-        if build_style == "debug":
-            command.append("--debug")
-        if build_style == "release":
-            command.append("--release")
-        return command
-
-    def run_javascriptcore_tests_command(self):
-        return self.script_shell_command("run-javascriptcore-tests")
-
-    def run_webkit_unit_tests_command(self):
-        return None
-
-    def run_webkit_tests_command(self):
-        return self.script_shell_command("run-webkit-tests")
-
-    def run_python_unittests_command(self):
-        return self.script_shell_command("test-webkitpy")
-
-    def run_perl_unittests_command(self):
-        return self.script_shell_command("test-webkitperl")
-
-    def run_bindings_tests_command(self):
-        return self.script_shell_command("run-bindings-tests")
-
 
 class VirtualTestSuite(object):
     def __init__(self, name, base, args, tests=None):
index 488938c..c04cae0 100644 (file)
@@ -463,12 +463,6 @@ class PortTest(unittest.TestCase):
         port = self.make_port(options=optparse.Values({'build_directory': '/my-build-directory/'}))
         self.assertEqual(port._build_path(), '/my-build-directory/Release')
 
-    def test_build_webkit_command(self):
-        port = self.make_port()
-        self.assertEqual(port.build_webkit_command(), ["Tools/Scripts/build-webkit"])
-        self.assertEqual(port.build_webkit_command("release"), ["Tools/Scripts/build-webkit", "--release"])
-        self.assertEqual(port.build_webkit_command("debug"), ["Tools/Scripts/build-webkit", "--debug"])
-
 
 class NaturalCompareTest(unittest.TestCase):
     def setUp(self):
index e58e275..b314b47 100644 (file)
@@ -31,8 +31,6 @@ from webkitpy.common.system.outputcapture import OutputCapture
 from webkitpy.port.efl import EflPort
 from webkitpy.port.pulseaudio_sanitizer_mock import PulseAudioSanitizerMock
 from webkitpy.port import port_testcase
-from webkitpy.port.base import Port
-from webkitpy.tool.mocktool import MockOptions
 
 
 class EflPortTest(port_testcase.PortTestCase):
@@ -51,33 +49,6 @@ class EflPortTest(port_testcase.PortTestCase):
         expected_logs = "MOCK run_command: ['Tools/Scripts/run-launcher', '--release', '--efl', 'file://test.html'], cwd=/mock-checkout\n"
         OutputCapture().assert_outputs(self, port.show_results_html_file, ["test.html"], expected_logs=expected_logs)
 
-    def test_commands(self):
-        port = self.make_port(port_name="efl")
-        self.assertEqual(port.tooling_flag(), "--port=efl")
-        self.assertEqual(port.update_webkit_command(), Port.script_shell_command("update-webkit"))
-        self.assertEqual(port.check_webkit_style_command(), Port.script_shell_command("check-webkit-style"))
-        self.assertEqual(port.prepare_changelog_command(), Port.script_shell_command("prepare-ChangeLog"))
-        self.assertEqual(port.build_webkit_command(), Port.script_shell_command("build-webkit") + ["--efl", "--update-efl", "--no-webkit2", port.make_args()])
-        self.assertEqual(port.run_javascriptcore_tests_command(), Port.script_shell_command("run-javascriptcore-tests"))
-        self.assertEqual(port.run_webkit_unit_tests_command(), None)
-        self.assertEqual(port.run_webkit_tests_command(), Port.script_shell_command("run-webkit-tests"))
-        self.assertEqual(port.run_python_unittests_command(), Port.script_shell_command("test-webkitpy"))
-        self.assertEqual(port.run_perl_unittests_command(), Port.script_shell_command("test-webkitperl"))
-        self.assertEqual(port.run_bindings_tests_command(), Port.script_shell_command("run-bindings-tests"))
-
-        port = self.make_port(port_name="efl", options=MockOptions(webkit_test_runner=True))
-        self.assertEqual(port.tooling_flag(), "--port=efl-wk2")
-        self.assertEqual(port.update_webkit_command(), Port.script_shell_command("update-webkit"))
-        self.assertEqual(port.check_webkit_style_command(), Port.script_shell_command("check-webkit-style"))
-        self.assertEqual(port.prepare_changelog_command(), Port.script_shell_command("prepare-ChangeLog"))
-        self.assertEqual(port.build_webkit_command(), Port.script_shell_command("build-webkit") + ["--efl", "--update-efl", "--no-webkit1", port.make_args()])
-        self.assertEqual(port.run_javascriptcore_tests_command(), Port.script_shell_command("run-javascriptcore-tests"))
-        self.assertEqual(port.run_webkit_unit_tests_command(), None)
-        self.assertEqual(port.run_webkit_tests_command(), Port.script_shell_command("run-webkit-tests"))
-        self.assertEqual(port.run_python_unittests_command(), Port.script_shell_command("test-webkitpy"))
-        self.assertEqual(port.run_perl_unittests_command(), Port.script_shell_command("test-webkitperl"))
-        self.assertEqual(port.run_bindings_tests_command(), Port.script_shell_command("run-bindings-tests"))
-
     def test_get_crash_log(self):
         # This function tested in linux_get_crash_log_unittest.py
         pass
index 9e6d5d4..1b66d91 100644 (file)
@@ -36,7 +36,6 @@ from webkitpy.common.system.outputcapture import OutputCapture
 from webkitpy.port.gtk import GtkPort
 from webkitpy.port.pulseaudio_sanitizer_mock import PulseAudioSanitizerMock
 from webkitpy.port import port_testcase
-from webkitpy.port.base import Port
 from webkitpy.thirdparty.mock import Mock
 from webkitpy.tool.mocktool import MockOptions
 
@@ -85,30 +84,3 @@ class GtkPortTest(port_testcase.PortTestCase):
     def test_get_crash_log(self):
         # This function tested in linux_get_crash_log_unittest.py
         pass
-
-    def test_commands(self):
-        port = self.make_port(port_name="gtk")
-        self.assertEqual(port.tooling_flag(), "--port=gtk")
-        self.assertEqual(port.update_webkit_command(), Port.script_shell_command("update-webkit"))
-        self.assertEqual(port.check_webkit_style_command(), Port.script_shell_command("check-webkit-style"))
-        self.assertEqual(port.prepare_changelog_command(), Port.script_shell_command("prepare-ChangeLog"))
-        self.assertEqual(port.build_webkit_command(), Port.script_shell_command("build-webkit") + ["--gtk", "--update-gtk", "--no-webkit2", port.make_args()])
-        self.assertEqual(port.run_javascriptcore_tests_command(), Port.script_shell_command("run-javascriptcore-tests"))
-        self.assertEqual(port.run_webkit_unit_tests_command(), None)
-        self.assertEqual(port.run_webkit_tests_command(), Port.script_shell_command("run-webkit-tests") + ["--gtk"])
-        self.assertEqual(port.run_python_unittests_command(), Port.script_shell_command("test-webkitpy"))
-        self.assertEqual(port.run_perl_unittests_command(), Port.script_shell_command("test-webkitperl"))
-        self.assertEqual(port.run_bindings_tests_command(), Port.script_shell_command("run-bindings-tests"))
-
-        port = self.make_port(port_name="gtk", options=MockOptions(webkit_test_runner=True))
-        self.assertEqual(port.tooling_flag(), "--port=gtk-wk2")
-        self.assertEqual(port.update_webkit_command(), Port.script_shell_command("update-webkit"))
-        self.assertEqual(port.check_webkit_style_command(), Port.script_shell_command("check-webkit-style"))
-        self.assertEqual(port.prepare_changelog_command(), Port.script_shell_command("prepare-ChangeLog"))
-        self.assertEqual(port.build_webkit_command(), Port.script_shell_command("build-webkit") + ["--gtk", "--update-gtk", "--no-webkit1", port.make_args()])
-        self.assertEqual(port.run_javascriptcore_tests_command(), Port.script_shell_command("run-javascriptcore-tests"))
-        self.assertEqual(port.run_webkit_unit_tests_command(), None)
-        self.assertEqual(port.run_webkit_tests_command(), Port.script_shell_command("run-webkit-tests") + ["--gtk", "-2"])
-        self.assertEqual(port.run_python_unittests_command(), Port.script_shell_command("test-webkitpy"))
-        self.assertEqual(port.run_perl_unittests_command(), Port.script_shell_command("test-webkitperl"))
-        self.assertEqual(port.run_bindings_tests_command(), Port.script_shell_command("run-bindings-tests"))
index b2409af..e58904a 100644 (file)
 # (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.port.mac import MacPort
+from webkitpy.port import port_testcase
 from webkitpy.common.system.filesystem_mock import MockFileSystem
 from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.tool.mocktool import MockOptions
 from webkitpy.common.system.executive_mock import MockExecutive, MockExecutive2, MockProcess, ScriptError
 from webkitpy.common.system.systemhost_mock import MockSystemHost
-from webkitpy.port import port_testcase
-from webkitpy.port.base import Port
-from webkitpy.port.mac import MacPort
-from webkitpy.tool.mocktool import MockOptions
 
 
 class MacTest(port_testcase.PortTestCase):
@@ -256,30 +255,3 @@ java/
         port._run_script = run_script
         port._build_driver()
         self.assertEqual(self.args, [])
-
-    def test_commands(self):
-        port = self.make_port(port_name="mac")
-        self.assertEqual(port.tooling_flag(), "--port=mac")
-        self.assertEqual(port.update_webkit_command(), Port.script_shell_command("update-webkit"))
-        self.assertEqual(port.check_webkit_style_command(), Port.script_shell_command("check-webkit-style"))
-        self.assertEqual(port.prepare_changelog_command(), Port.script_shell_command("prepare-ChangeLog"))
-        self.assertEqual(port.build_webkit_command(), Port.script_shell_command("build-webkit"))
-        self.assertEqual(port.run_javascriptcore_tests_command(), Port.script_shell_command("run-javascriptcore-tests"))
-        self.assertEqual(port.run_webkit_unit_tests_command(), None)
-        self.assertEqual(port.run_webkit_tests_command(), Port.script_shell_command("run-webkit-tests"))
-        self.assertEqual(port.run_python_unittests_command(), Port.script_shell_command("test-webkitpy"))
-        self.assertEqual(port.run_perl_unittests_command(), Port.script_shell_command("test-webkitperl"))
-        self.assertEqual(port.run_bindings_tests_command(), Port.script_shell_command("run-bindings-tests"))
-
-        port = self.make_port(port_name="mac", options=MockOptions(webkit_test_runner=True))
-        self.assertEqual(port.tooling_flag(), "--port=mac-wk2")
-        self.assertEqual(port.update_webkit_command(), Port.script_shell_command("update-webkit"))
-        self.assertEqual(port.check_webkit_style_command(), Port.script_shell_command("check-webkit-style"))
-        self.assertEqual(port.prepare_changelog_command(), Port.script_shell_command("prepare-ChangeLog"))
-        self.assertEqual(port.build_webkit_command(), Port.script_shell_command("build-webkit"))
-        self.assertEqual(port.run_javascriptcore_tests_command(), Port.script_shell_command("run-javascriptcore-tests"))
-        self.assertEqual(port.run_webkit_unit_tests_command(), None)
-        self.assertEqual(port.run_webkit_tests_command(), Port.script_shell_command("run-webkit-tests"))
-        self.assertEqual(port.run_python_unittests_command(), Port.script_shell_command("test-webkitpy"))
-        self.assertEqual(port.run_perl_unittests_command(), Port.script_shell_command("test-webkitperl"))
-        self.assertEqual(port.run_bindings_tests_command(), Port.script_shell_command("run-bindings-tests"))
index 6bb19b0..76fea3b 100644 (file)
@@ -537,39 +537,6 @@ class TestPort(Port):
             VirtualTestSuite('virtual/skipped', 'failures/expected', ['--virtual-arg2']),
         ]
 
-    def make_args(self):
-        return '--makeargs="-j4"'
-
-    def check_webkit_style_command(self):
-        return ["mock-check-webkit-style"]
-
-    def update_webkit_command(self, non_interactive=False):
-        return ["mock-update-webkit"]
-
-    def build_webkit_command(self, build_style=None):
-        return ["mock-build-webkit"]
-
-    def prepare_changelog_command(self):
-        return ['mock-prepare-ChangeLog']
-
-    def run_python_unittests_command(self):
-        return ['mock-test-webkitpy']
-
-    def run_perl_unittests_command(self):
-        return ['mock-test-webkitperl']
-
-    def run_javascriptcore_tests_command(self):
-        return ['mock-run-javascriptcore-tests']
-
-    def run_webkit_unit_tests_command(self):
-        return ['mock-run-webkit-unit-tests']
-
-    def run_webkit_tests_command(self):
-        return ['mock-run-webkit-tests']
-
-    def run_bindings_tests_command(self):
-        return ['mock-run-bindings-tests']
-
 
 class TestDriver(Driver):
     """Test/Dummy implementation of the DumpRenderTree interface."""
index 49b2469..b9fdf66 100644 (file)
@@ -43,7 +43,7 @@ class FlakyTestReporter(object):
         self._tool = tool
         self._bot_name = bot_name
         # FIXME: Use the real port object
-        self._bot_info = BotInfo(tool, tool.port().name())
+        self._bot_info = BotInfo(tool, tool.deprecated_port().name())
 
     def _author_emails_for_test(self, flaky_test):
         test_path = path_for_layout_test(flaky_test)
index cbf542a..bcce53e 100644 (file)
@@ -216,7 +216,7 @@ class Rollout(IRCCommand):
 
     def _update_working_copy(self, tool):
         tool.scm().discard_local_changes()
-        tool.executive.run_and_throw_if_fail(tool.port().update_webkit_command(), quiet=True, cwd=tool.scm().checkout_root)
+        tool.executive.run_and_throw_if_fail(tool.deprecated_port().update_webkit_command(), quiet=True, cwd=tool.scm().checkout_root)
 
     def _check_diff_failure(self, error_log, tool):
         if not error_log:
index a1323a9..d35706f 100644 (file)
@@ -168,7 +168,7 @@ MOCK run_and_throw_if_fail: ['mock-test-webkitpy'], cwd=/mock-checkout
 Running Perl unit tests
 MOCK run_and_throw_if_fail: ['mock-test-webkitperl'], cwd=/mock-checkout
 Running JavaScriptCore tests
-MOCK run_and_throw_if_fail: ['mock-run-javascriptcore-tests'], cwd=/mock-checkout
+MOCK run_and_throw_if_fail: ['mock-run-javacriptcore-tests'], cwd=/mock-checkout
 Running bindings generation tests
 MOCK run_and_throw_if_fail: ['mock-run-bindings-tests'], cwd=/mock-checkout
 Running WebKit unit tests
index ecbac64..b5e285c 100644 (file)
@@ -31,6 +31,7 @@ import logging
 from optparse import make_option
 
 from webkitpy.common.config.committers import CommitterList
+from webkitpy.common.config.ports import DeprecatedPort
 from webkitpy.common.system.filesystem import FileSystem
 from webkitpy.common.system.executive import ScriptError
 from webkitpy.tool.bot.earlywarningsystemtask import EarlyWarningSystemTask, EarlyWarningSystemTaskDelegate
@@ -102,7 +103,7 @@ class AbstractEarlyWarningSystem(AbstractReviewQueue, EarlyWarningSystemTaskDele
         return self.name
 
     def run_command(self, command):
-        self.run_webkit_patch(command + [self._port.tooling_flag()])
+        self.run_webkit_patch(command + [self._deprecated_port.flag()])
 
     def command_passed(self, message, patch):
         pass
index badd301..74724cf 100644 (file)
@@ -39,6 +39,7 @@ from optparse import make_option
 from StringIO import StringIO
 
 from webkitpy.common.config.committervalidator import CommitterValidator
+from webkitpy.common.config.ports import DeprecatedPort
 from webkitpy.common.net.bugzilla import Attachment
 from webkitpy.common.net.statusserver import StatusServer
 from webkitpy.common.system.executive import ScriptError
@@ -272,9 +273,11 @@ class PatchProcessingQueue(AbstractPatchQueue):
         AbstractPatchQueue.begin_work_queue(self)
         if not self.port_name:
             return
-        self._port = self._tool.port_factory.get(self._new_port_name_from_old(self.port_name, self._tool.platform))
+        # FIXME: This is only used for self._deprecated_port.flag()
+        self._deprecated_port = DeprecatedPort.port(self.port_name)
         # FIXME: This violates abstraction
-        self._tool._port = self._port
+        self._tool._deprecated_port = self._deprecated_port
+        self._port = self._tool.port_factory.get(self._new_port_name_from_old(self.port_name, self._tool.platform))
 
     def _upload_results_archive_for_patch(self, patch, results_archive_zip):
         if not self._port:
@@ -347,7 +350,7 @@ class CommitQueue(PatchProcessingQueue, StepSequenceErrorHandler, CommitQueueTas
     # CommitQueueTaskDelegate methods
 
     def run_command(self, command):
-        self.run_webkit_patch(command + [self._port.tooling_flag()])
+        self.run_webkit_patch(command + [self._deprecated_port.flag()])
 
     def command_passed(self, message, patch):
         self._update_status(message, patch=patch)
index 92240cc..9f50e39 100644 (file)
@@ -33,10 +33,10 @@ from optparse import make_option
 import os
 import threading
 
+from webkitpy.common.config.ports import DeprecatedPort
 from webkitpy.common.host import Host
 from webkitpy.common.net.irc import ircproxy
 from webkitpy.common.net.statusserver import StatusServer
-from webkitpy.port.factory import PortFactory
 from webkitpy.tool.multicommandtool import MultiCommandTool
 from webkitpy.tool import commands
 
@@ -60,10 +60,10 @@ class WebKitPatch(MultiCommandTool, Host):
 
         self.wakeup_event = threading.Event()
         self._irc = None
-        self._port = None
+        self._deprecated_port = None
 
-    def port(self):
-        return self._port
+    def deprecated_port(self):
+        return self._deprecated_port
 
     def path(self):
         return self._path
@@ -99,7 +99,7 @@ class WebKitPatch(MultiCommandTool, Host):
         if options.irc_password:
             self.irc_password = options.irc_password
         # If options.port is None, we'll get the default port for this platform.
-        self._port = self.port_factory.get(options.port)
+        self._deprecated_port = DeprecatedPort.port(options.port)
 
     def should_execute_command(self, command):
         if command.requires_local_commits and not self.scm().supports_local_commits():
index 25ff8c6..175d1b8 100644 (file)
@@ -32,7 +32,9 @@ from webkitpy.common.host_mock import MockHost
 from webkitpy.common.net.buildbot.buildbot_mock import MockBuildBot
 from webkitpy.common.net.statusserver_mock import MockStatusServer
 from webkitpy.common.net.irc.irc_mock import MockIRC
-from webkitpy.port.test import TestPort
+
+# FIXME: Old-style "Ports" need to die and be replaced by modern layout_tests.port which needs to move to common.
+from webkitpy.common.config.ports_mock import MockPort
 
 
 # FIXME: We should just replace this with optparse.Values(default=kwargs)
@@ -62,16 +64,15 @@ class MockTool(MockHost):
     def __init__(self, *args, **kwargs):
         MockHost.__init__(self, *args, **kwargs)
 
-        self._port = TestPort(self)
-        self._port.name = lambda: "MockPort"
+        self._deprecated_port = MockPort()
         self.status_server = MockStatusServer()
 
         self._irc = None
         self.irc_password = "MOCK irc password"
         self.wakeup_event = threading.Event()
 
-    def port(self):
-        return self._port
+    def deprecated_port(self):
+        return self._deprecated_port
 
     def path(self):
         return "echo"
index a2a6272..b02830c 100644 (file)
@@ -48,7 +48,7 @@ class Build(AbstractStep):
         environment.disable_gcc_smartquotes()
         env = environment.to_dictionary()
 
-        build_webkit_command = self._tool.port().build_webkit_command(build_style=build_style)
+        build_webkit_command = self._tool.deprecated_port().build_webkit_command(build_style=build_style)
         self._tool.executive.run_and_throw_if_fail(build_webkit_command, self._options.quiet,
             cwd=self._tool.scm().checkout_root, env=env)
 
index 0cb15f4..cec8a81 100644 (file)
@@ -57,7 +57,7 @@ class CheckStyle(AbstractStep):
             args.append(self._options.check_style_filter)
 
         try:
-            self._tool.executive.run_and_throw_if_fail(self._tool.port().check_webkit_style_command() + args, cwd=self._tool.scm().checkout_root)
+            self._tool.executive.run_and_throw_if_fail(self._tool.deprecated_port().check_webkit_style_command() + args, cwd=self._tool.scm().checkout_root)
         except ScriptError, e:
             if self._options.non_interactive:
                 # We need to re-raise the exception here to have the
index c52a63a..1d5109a 100644 (file)
@@ -60,7 +60,7 @@ class Commit(AbstractStep):
         args = ["--diff-files"]
         args.extend(test_expectations_files)
         try:
-            self._tool.executive.run_and_throw_if_fail(self._tool.port().check_webkit_style_command() + args, cwd=self._tool.scm().checkout_root)
+            self._tool.executive.run_and_throw_if_fail(self._tool.deprecated_port().check_webkit_style_command() + args, cwd=self._tool.scm().checkout_root)
         except ScriptError, e:
             if self._options.non_interactive:
                 raise
index 93b602e..716ab82 100644 (file)
@@ -107,7 +107,7 @@ class PrepareChangeLog(AbstractStep):
             if not self._options.update_changelogs:
                 return
 
-        args = self._tool.port().prepare_changelog_command()
+        args = self._tool.deprecated_port().prepare_changelog_command()
         if state.get("bug_id"):
             args.append("--bug=%s" % state["bug_id"])
             args.append("--description=%s" % self.cached_lookup(state, 'bug_title'))
index 95a99c3..82e7b02 100644 (file)
@@ -48,7 +48,7 @@ class PrepareChangeLogForRevert(AbstractStep):
 
     def run(self, state):
         # This could move to prepare-ChangeLog by adding a --revert= option.
-        self._tool.executive.run_and_throw_if_fail(self._tool.port().prepare_changelog_command(), cwd=self._tool.scm().checkout_root)
+        self._tool.executive.run_and_throw_if_fail(self._tool.deprecated_port().prepare_changelog_command(), cwd=self._tool.scm().checkout_root)
         changelog_paths = self._tool.checkout().modified_changelogs(git_commit=None)
         bug_url = self._tool.bugs.bug_url_for_bug_id(state["bug_id"]) if state["bug_id"] else None
         message = self._message_for_revert(state["revision_list"], state["reason"], bug_url)
index 9147186..a45628b 100644 (file)
@@ -56,22 +56,22 @@ class RunTests(AbstractStep):
         if not self._options.non_interactive:
             # FIXME: We should teach the commit-queue and the EWS how to run these tests.
 
-            python_unittests_command = self._tool.port().run_python_unittests_command()
+            python_unittests_command = self._tool.deprecated_port().run_python_unittests_command()
             if python_unittests_command:
                 _log.info("Running Python unit tests")
                 self._tool.executive.run_and_throw_if_fail(python_unittests_command, cwd=self._tool.scm().checkout_root)
 
-            perl_unittests_command = self._tool.port().run_perl_unittests_command()
+            perl_unittests_command = self._tool.deprecated_port().run_perl_unittests_command()
             if perl_unittests_command:
                 _log.info("Running Perl unit tests")
                 self._tool.executive.run_and_throw_if_fail(perl_unittests_command, cwd=self._tool.scm().checkout_root)
 
-            javascriptcore_tests_command = self._tool.port().run_javascriptcore_tests_command()
+            javascriptcore_tests_command = self._tool.deprecated_port().run_javascriptcore_tests_command()
             if javascriptcore_tests_command:
                 _log.info("Running JavaScriptCore tests")
                 self._tool.executive.run_and_throw_if_fail(javascriptcore_tests_command, quiet=True, cwd=self._tool.scm().checkout_root)
 
-        bindings_tests_command = self._tool.port().run_bindings_tests_command()
+        bindings_tests_command = self._tool.deprecated_port().run_bindings_tests_command()
         if bindings_tests_command:
             _log.info("Running bindings generation tests")
             args = bindings_tests_command
@@ -80,7 +80,7 @@ class RunTests(AbstractStep):
             except ScriptError, e:
                 _log.info("Error running run-bindings-tests: %s" % e.message_with_output())
 
-        webkit_unit_tests_command = self._tool.port().run_webkit_unit_tests_command()
+        webkit_unit_tests_command = self._tool.deprecated_port().run_webkit_unit_tests_command()
         if webkit_unit_tests_command:
             _log.info("Running WebKit unit tests")
             args = webkit_unit_tests_command
@@ -91,7 +91,7 @@ class RunTests(AbstractStep):
 
 
         _log.info("Running run-webkit-tests")
-        args = self._tool.port().run_webkit_tests_command()
+        args = self._tool.deprecated_port().run_webkit_tests_command()
         if self._options.non_interactive:
             args.extend([
                 "--no-new-test-results",
index 9aa4e89..ef8920e 100644 (file)
@@ -37,8 +37,8 @@ from webkitpy.tool.steps.runtests import RunTests
 class RunTestsTest(unittest.TestCase):
     def test_webkit_run_unit_tests(self):
         tool = MockTool(log_executive=True)
-        tool._port.run_python_unittests_command = lambda: None
-        tool._port.run_perl_unittests_command = lambda: None
+        tool._deprecated_port.run_python_unittests_command = lambda: None
+        tool._deprecated_port.run_perl_unittests_command = lambda: None
         step = RunTests(tool, MockOptions(test=True, non_interactive=True, quiet=False))
 
         if sys.platform != "cygwin":
index 8b528dc..7172ba7 100644 (file)
@@ -29,6 +29,7 @@
 import unittest2 as unittest
 
 from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.common.config.ports import DeprecatedPort
 from webkitpy.tool.mocktool import MockOptions, MockTool
 
 from webkitpy.tool import steps
@@ -99,18 +100,18 @@ class StepsTest(unittest.TestCase):
         mock_options.non_interactive = False
         step = steps.RunTests(MockTool(log_executive=True), mock_options)
         tool = MockTool(log_executive=True)
+        # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment.
+        tool._deprecated_port = DeprecatedPort()
         step = steps.RunTests(tool, mock_options)
         expected_logs = """Running Python unit tests
-MOCK run_and_throw_if_fail: ['mock-test-webkitpy'], cwd=/mock-checkout
+MOCK run_and_throw_if_fail: ['Tools/Scripts/test-webkitpy'], cwd=/mock-checkout
 Running Perl unit tests
-MOCK run_and_throw_if_fail: ['mock-test-webkitperl'], cwd=/mock-checkout
+MOCK run_and_throw_if_fail: ['Tools/Scripts/test-webkitperl'], cwd=/mock-checkout
 Running JavaScriptCore tests
-MOCK run_and_throw_if_fail: ['mock-run-javascriptcore-tests'], cwd=/mock-checkout
+MOCK run_and_throw_if_fail: ['Tools/Scripts/run-javascriptcore-tests'], cwd=/mock-checkout
 Running bindings generation tests
-MOCK run_and_throw_if_fail: ['mock-run-bindings-tests'], cwd=/mock-checkout
-Running WebKit unit tests
-MOCK run_and_throw_if_fail: ['mock-run-webkit-unit-tests'], cwd=/mock-checkout
+MOCK run_and_throw_if_fail: ['Tools/Scripts/run-bindings-tests'], cwd=/mock-checkout
 Running run-webkit-tests
-MOCK run_and_throw_if_fail: ['mock-run-webkit-tests', '--quiet'], cwd=/mock-checkout
+MOCK run_and_throw_if_fail: ['Tools/Scripts/run-webkit-tests', '--quiet'], cwd=/mock-checkout
 """
         OutputCapture().assert_outputs(self, step.run, [{}], expected_logs=expected_logs)
index 0737ebc..f703540 100644 (file)
@@ -50,5 +50,5 @@ class Update(AbstractStep):
         self._tool.executive.run_and_throw_if_fail(self._update_command(), quiet=self._options.quiet, cwd=self._tool.scm().checkout_root)
 
     def _update_command(self):
-        update_command = self._tool.port().update_webkit_command(self._options.non_interactive)
+        update_command = self._tool.deprecated_port().update_webkit_command(self._options.non_interactive)
         return update_command
index 9fe2d6f..49d6b40 100644 (file)
@@ -28,6 +28,7 @@
 
 import unittest2 as unittest
 
+from webkitpy.common.config.ports import MacPort, MacWK2Port
 from webkitpy.tool.mocktool import MockOptions, MockTool
 from webkitpy.tool.steps.update import Update
 
@@ -40,10 +41,10 @@ class UpdateTest(unittest.TestCase):
         step = Update(tool, options)
         self.assertEqual(["mock-update-webkit"], step._update_command())
 
-        tool._port = tool.port_factory.get("mac")
+        tool._deprecated_port = MacPort()
         self.assertEqual(["Tools/Scripts/update-webkit"], step._update_command())
 
-        tool._port = tool.port_factory.get("mac-wk2")
+        tool._deprecated_port = MacWK2Port()
         self.assertEqual(["Tools/Scripts/update-webkit"], step._update_command())
 
     def test_update_command_interactive(self):
@@ -52,8 +53,8 @@ class UpdateTest(unittest.TestCase):
         step = Update(tool, options)
         self.assertEqual(["mock-update-webkit"], step._update_command())
 
-        tool._port = tool.port_factory.get("mac")
+        tool._deprecated_port = MacPort()
         self.assertEqual(["Tools/Scripts/update-webkit"], step._update_command())
 
-        tool._port = tool.port_factory.get("mac-wk2")
+        tool._deprecated_port = MacWK2Port()
         self.assertEqual(["Tools/Scripts/update-webkit"], step._update_command())