Changeset 51231 in webkit


Ignore:
Timestamp:
Nov 19, 2009 10:43:40 PM (14 years ago)
Author:
eric@webkit.org
Message:

2009-11-19 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

Support Qt port in bugzilla-tool
https://bugs.webkit.org/show_bug.cgi?id=31701

Now we support building with Qt!

  • Scripts/bugzilla-tool:
  • Scripts/modules/webkitport.py: Added.
  • Scripts/modules/webkitport_unittest.py: Added.
  • Scripts/run-webkit-unittests:
Location:
trunk/WebKitTools
Files:
3 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r51230 r51231  
     12009-11-19  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Support Qt port in bugzilla-tool
     6        https://bugs.webkit.org/show_bug.cgi?id=31701
     7
     8        Now we support building with Qt!
     9
     10        * Scripts/bugzilla-tool:
     11        * Scripts/modules/webkitport.py: Added.
     12        * Scripts/modules/webkitport_unittest.py: Added.
     13        * Scripts/run-webkit-unittests:
     14
    1152009-11-19  Zoltan Horvath  <zoltan@webkit.org>
    216
  • trunk/WebKitTools/Scripts/bugzilla-tool

    r51223 r51231  
    5151from modules.scm import CommitMessage, detect_scm_system, ScriptError, CheckoutNeedsUpdate
    5252from modules.statusbot import StatusBot
     53from modules.webkitport import WebKitPort
    5354from modules.workqueue import WorkQueue, WorkQueueDelegate
    5455
     
    214215            make_option("--quiet", action="store_true", dest="quiet", default=False, help="Produce less console output."),
    215216            make_option("--non-interactive", action="store_true", dest="non_interactive", default=False, help="Never prompt the user, fail as fast as possible."),
    216         ]
     217        ] + WebKitPort.port_options()
    217218
    218219    @staticmethod
     
    245246            raise ScriptError(script_args=args, exit_code=exit_code, output=child_output)
    246247
    247     # We might need to pass scm into this function for scm.checkout_root
    248     @staticmethod
    249     def webkit_script_path(script_name):
    250         return os.path.join("WebKitTools", "Scripts", script_name)
    251 
    252248    @classmethod
    253     def run_webkit_script(cls, script_name, quiet=False):
     249    def run_webkit_script(cls, script_name, quiet=False, port=WebKitPort):
    254250        log("Running %s" % script_name)
    255         cls.run_and_throw_if_fail(cls.webkit_script_path(script_name), quiet)
     251        cls.run_and_throw_if_fail(port.script_path(script_name), quiet)
    256252
    257253    @classmethod
    258     def build_webkit(cls, quiet=False):
    259         cls.run_webkit_script("build-webkit", quiet)
     254    def build_webkit(cls, quiet=False, port=WebKitPort):
     255        log("Building WebKit")
     256        cls.run_and_throw_if_fail(port.build_webkit_command(), quiet)
    260257
    261258    @staticmethod
     
    266263
    267264    @classmethod
    268     def run_webkit_tests(cls, launch_safari, fail_fast=False, quiet=False):
    269         args = [cls.webkit_script_path("run-webkit-tests")]
     265    def run_webkit_tests(cls, launch_safari, fail_fast=False, quiet=False, port=WebKitPort):
     266        args = port.run_webkit_tests_command()
    270267        if not launch_safari:
    271268            args.append("--no-launch-safari")
     
    286283    @classmethod
    287284    def build_and_commit(cls, scm, options):
     285        port = WebKitPort.get_port(options)
    288286        if options.build:
    289             cls.build_webkit(quiet=options.quiet)
     287            cls.build_webkit(quiet=options.quiet, port=port)
    290288            if options.test:
    291289                # When running the commit-queue we don't want to launch Safari and we want to exit after the first failure.
    292                 cls.run_webkit_tests(launch_safari=not options.non_interactive, fail_fast=options.non_interactive, quiet=options.quiet)
     290                cls.run_webkit_tests(launch_safari=not options.non_interactive, fail_fast=options.non_interactive, quiet=options.quiet, port=port)
    293291        commit_message = commit_message_for_this_commit(scm)
    294292        commit_log = scm.commit_with_message(commit_message.message())
  • trunk/WebKitTools/Scripts/modules/webkitport.py

    • Property svn:executable deleted
    r51230 r51231  
    1 #!/usr/bin/env python
    2 # Copyright (c) 2009 Google Inc. All rights reserved.
    3 #
     1# Copyright (C) 2009, Google Inc. All rights reserved.
     2#
    43# Redistribution and use in source and binary forms, with or without
    54# modification, are permitted provided that the following conditions are
     
    2726# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    2827# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     28#
     29# WebKit's Python module for understanding the various ports
    2930
    30 import unittest
     31import os
    3132
    32 from modules.bugzilla_unittest import *
    33 from modules.buildbot_unittest import *
    34 from modules.changelogs_unittest import *
    35 from modules.committers_unittest import *
    36 from modules.cpp_style_unittest import *
    37 from modules.diff_parser_unittest import *
    38 from modules.logging_unittest import *
    39 from modules.multicommandtool_unittest import *
    40 from modules.patchcollection_unittest import *
    41 from modules.scm_unittest import *
    42 from modules.workqueue_unittest import *
     33from optparse import make_option
    4334
    44 if __name__ == "__main__":
    45     unittest.main()
     35class WebKitPort():
     36    # We might need to pass scm into this function for scm.checkout_root
     37    @classmethod
     38    def script_path(cls, script_name):
     39        return os.path.join("WebKitTools", "Scripts", script_name)
     40
     41    @staticmethod
     42    def port_options():
     43        return [
     44            make_option("--qt", action="store_true", dest="qt", default=False, help="Use the Qt port."),
     45        ]
     46
     47    @staticmethod
     48    def get_port(options):
     49        if options.qt:
     50            return QtPort
     51        return MacPort
     52
     53    @classmethod
     54    def name(cls):
     55        raise NotImplementedError, "subclasses must implement"
     56
     57    @classmethod
     58    def run_webkit_tests_command(cls):
     59        return [cls.script_path("run-webkit-tests")]
     60
     61    @classmethod
     62    def build_webkit_command(cls):
     63        return [cls.script_path("build-webkit")]
     64
     65
     66class MacPort(WebKitPort):
     67    @classmethod
     68    def name(cls):
     69        return "Mac"
     70
     71
     72class QtPort(WebKitPort):
     73    @classmethod
     74    def name(cls):
     75        return "Qt"
     76
     77    @classmethod
     78    def build_webkit_command(cls):
     79        command = WebKitPort.build_webkit_command()
     80        command.append("--qt")
     81        return command
  • trunk/WebKitTools/Scripts/modules/webkitport_unittest.py

    • Property svn:executable deleted
    r51230 r51231  
    11#!/usr/bin/env python
    2 # Copyright (c) 2009 Google Inc. All rights reserved.
     2# Copyright (c) 2009, Google Inc. All rights reserved.
    33#
    44# Redistribution and use in source and binary forms, with or without
     
    3030import unittest
    3131
    32 from modules.bugzilla_unittest import *
    33 from modules.buildbot_unittest import *
    34 from modules.changelogs_unittest import *
    35 from modules.committers_unittest import *
    36 from modules.cpp_style_unittest import *
    37 from modules.diff_parser_unittest import *
    38 from modules.logging_unittest import *
    39 from modules.multicommandtool_unittest import *
    40 from modules.patchcollection_unittest import *
    41 from modules.scm_unittest import *
    42 from modules.workqueue_unittest import *
     32from modules.webkitport import WebKitPort, MacPort, QtPort
    4333
    44 if __name__ == "__main__":
     34class WebKitPortTest(unittest.TestCase):
     35    def test_mac_port(self):
     36        self.assertEquals(MacPort.name(), "Mac")
     37        self.assertEquals(MacPort.run_webkit_tests_command(), [WebKitPort.script_path("run-webkit-tests")])
     38        self.assertEquals(MacPort.build_webkit_command(), [WebKitPort.script_path("build-webkit")])
     39
     40    def test_qt_port(self):
     41        self.assertEquals(QtPort.name(), "Qt")
     42        self.assertEquals(QtPort.run_webkit_tests_command(), [WebKitPort.script_path("run-webkit-tests")])
     43        self.assertEquals(QtPort.build_webkit_command(), [WebKitPort.script_path("build-webkit"), "--qt"])
     44
     45
     46if __name__ == '__main__':
    4547    unittest.main()
  • trunk/WebKitTools/Scripts/run-webkit-unittests

    r51223 r51231  
    4040from modules.patchcollection_unittest import *
    4141from modules.scm_unittest import *
     42from modules.webkitport_unittest import *
    4243from modules.workqueue_unittest import *
    4344
Note: See TracChangeset for help on using the changeset viewer.