Title: [90796] trunk/Tools
Revision
90796
Author
[email protected]
Date
2011-07-11 17:10:19 -0700 (Mon, 11 Jul 2011)

Log Message

nrwt: linting fixes
https://bugs.webkit.org/show_bug.cgi?id=64225

Reviewed by Eric Siedel.

Miscellaneous linting fixes. The most notable change is that
we add public attributes for user, executive, filesystem, and
options on the Port object, so we don't have to refer to the
"protected" versions all over the place".

* Scripts/webkitpy/layout_tests/controllers/manager.py:
* Scripts/webkitpy/layout_tests/controllers/manager_worker_broker.py:
* Scripts/webkitpy/layout_tests/controllers/message_broker.py:
* Scripts/webkitpy/layout_tests/controllers/message_broker_unittest.py:
* Scripts/webkitpy/layout_tests/controllers/worker.py:
* Scripts/webkitpy/layout_tests/port/base.py:
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (90795 => 90796)


--- trunk/Tools/ChangeLog	2011-07-11 23:55:16 UTC (rev 90795)
+++ trunk/Tools/ChangeLog	2011-07-12 00:10:19 UTC (rev 90796)
@@ -1,3 +1,23 @@
+2011-07-08  Dirk Pranke  <[email protected]>
+
+        nrwt: linting fixes
+        https://bugs.webkit.org/show_bug.cgi?id=64225
+
+        Reviewed by Eric Siedel.
+
+        Miscellaneous linting fixes. The most notable change is that
+        we add public attributes for user, executive, filesystem, and
+        options on the Port object, so we don't have to refer to the
+        "protected" versions all over the place".
+
+        * Scripts/webkitpy/layout_tests/controllers/manager.py:
+        * Scripts/webkitpy/layout_tests/controllers/manager_worker_broker.py:
+        * Scripts/webkitpy/layout_tests/controllers/message_broker.py:
+        * Scripts/webkitpy/layout_tests/controllers/message_broker_unittest.py:
+        * Scripts/webkitpy/layout_tests/controllers/worker.py:
+        * Scripts/webkitpy/layout_tests/port/base.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
 2011-07-11  Ryosuke Niwa  <[email protected]>
 
         webkit-patch roll-chromium-deps no longer works

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py (90795 => 90796)


--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py	2011-07-11 23:55:16 UTC (rev 90795)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py	2011-07-12 00:10:19 UTC (rev 90796)
@@ -37,7 +37,6 @@
 
 from __future__ import with_statement
 
-import copy
 import errno
 import logging
 import math
@@ -53,7 +52,6 @@
 from webkitpy.layout_tests.controllers import worker
 from webkitpy.layout_tests.layout_package import json_layout_results_generator
 from webkitpy.layout_tests.layout_package import json_results_generator
-from webkitpy.layout_tests.layout_package import test_results_uploader
 from webkitpy.layout_tests.models import test_expectations
 from webkitpy.layout_tests.models import test_failures
 from webkitpy.layout_tests.models import test_results
@@ -61,7 +59,6 @@
 from webkitpy.layout_tests.models.result_summary import ResultSummary
 from webkitpy.layout_tests.views import printing
 
-from webkitpy.thirdparty import simplejson
 from webkitpy.tool import grammar
 
 _log = logging.getLogger(__name__)
@@ -223,6 +220,7 @@
 class TestRunInterruptedException(Exception):
     """Raised when a test run should be stopped immediately."""
     def __init__(self, reason):
+        Exception.__init__(self)
         self.reason = reason
         self.msg = reason
 
@@ -269,10 +267,11 @@
           printer: a Printer object to record updates to.
         """
         self._port = port
-        self._fs = port._filesystem
+        self._fs = port.filesystem
         self._options = options
         self._printer = printer
         self._message_broker = None
+        self._expectations = None
 
         self.HTTP_SUBDIR = port.TEST_PATH_SEPARATOR + 'http' + port.TEST_PATH_SEPARATOR
         self.WEBSOCKET_SUBDIR = port.TEST_PATH_SEPARATOR + 'websocket' + port.TEST_PATH_SEPARATOR
@@ -322,7 +321,7 @@
         if path.startswith(self.LAYOUT_TESTS_DIRECTORY + self._port.TEST_PATH_SEPARATOR):
             return path[len(self.LAYOUT_TESTS_DIRECTORY + self._port.TEST_PATH_SEPARATOR):]
         if path.startswith(self.LAYOUT_TESTS_DIRECTORY + self._fs.sep):
-            return path[len(self.LAYOUT_TEST_DIRECTORY + self._fs.sep):]
+            return path[len(self.LAYOUT_TESTS_DIRECTORY + self._fs.sep):]
         return path
 
     def lint(self):
@@ -408,7 +407,7 @@
                 assert(chunk_num >= 0)
                 test_size = int(chunk_len)
                 assert(test_size > 0)
-            except:
+            except AssertionError:
                 _log.critical("invalid chunk '%s'" % chunk_value)
                 return None
 
@@ -754,15 +753,15 @@
         # are sent after all of the tests, and because each worker will stop
         # reading messsages after receiving a stop, we can be sure each
         # worker will get a stop message and hence they will all shut down.
-        for i in xrange(num_workers):
+        for _ in xrange(num_workers):
             manager_connection.post_message('stop')
 
         try:
             while not self.is_done():
                 # Temporarily disabled to see how this code effect performance on the buildbots.
-                # if self._port.executive().running_pids(self._port.is_crash_reporter):
+                # if self._port.executive.running_pids(self._port.is_crash_reporter):
                 #     self._printer.print_update("Waiting for crash reporter ...")
-                #     self._port.executive().wait_newest(self._port.is_crash_reporter)
+                #     self._port.executive.wait_newest(self._port.is_crash_reporter)
                 manager_connection.run_message_loop(delay_secs=1.0)
 
             # Make sure all of the workers have shut down (if possible).
@@ -1091,7 +1090,7 @@
 
         generator.upload_json_files(json_files)
 
-    def _print_config(self):
+    def print_config(self):
         """Prints the configuration for the test run."""
         p = self._printer
         p.print_config("Using port '%s'" % self._port.name())
@@ -1291,8 +1290,8 @@
 
         mean = sum(timings) / num_tests
 
-        for time in timings:
-            sum_of_deviations = math.pow(time - mean, 2)
+        for timing in timings:
+            sum_of_deviations = math.pow(timing - mean, 2)
 
         std_deviation = math.sqrt(sum_of_deviations / num_tests)
         self._printer.print_timing("  Median:          %6.3f" % median)
@@ -1437,7 +1436,7 @@
         self._update_summary_with_result(self._current_result_summary, result)
 
     def _log_worker_stack(self, stack):
-        webkitpydir = self._port.path_from_webkit_base('Tools', 'Scripts', 'webkitpy') + self._port._filesystem.sep
+        webkitpydir = self._port.path_from_webkit_base('Tools', 'Scripts', 'webkitpy') + self._port.filesystem.sep
         for filename, line_number, function_name, text in stack:
             if filename.startswith(webkitpydir):
                 filename = filename.replace(webkitpydir, '')
@@ -1445,13 +1444,13 @@
             _log.error('    %s' % text)
 
 
-def read_test_files(fs, files, test_path_separator):
+def read_test_files(fs, filenames, test_path_separator):
     tests = []
-    for file in files:
+    for filename in filenames:
         try:
             if test_path_separator != fs.sep:
-                file = file.replace(test_path_separator, fs.sep)
-            file_contents = fs.read_text_file(file).split('\n')
+                filename = filename.replace(test_path_separator, fs.sep)
+            file_contents = fs.read_text_file(filename).split('\n')
             for line in file_contents:
                 line = test_expectations.strip_comments(line)
                 if line:
@@ -1488,7 +1487,7 @@
     def tryint(val):
         try:
             return int(val)
-        except:
+        except ValueError:
             return val
 
     return [tryint(chunk) for chunk in re.split('(\d+)', string_to_split)]

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager_worker_broker.py (90795 => 90796)


--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager_worker_broker.py	2011-07-11 23:55:16 UTC (rev 90795)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager_worker_broker.py	2011-07-12 00:10:19 UTC (rev 90796)
@@ -45,9 +45,6 @@
 import optparse
 import Queue
 import sys
-import thread
-import threading
-import time
 
 # Handle Python < 2.6 where multiprocessing isn't available.
 try:
@@ -55,8 +52,7 @@
 except ImportError:
     multiprocessing = None
 
-from webkitpy.common.system import stack_utils
-from webkitpy.layout_tests import port
+from webkitpy import layout_tests
 from webkitpy.layout_tests.controllers import message_broker
 from webkitpy.layout_tests.views import printing
 
@@ -111,7 +107,7 @@
 
 
 class AbstractWorker(message_broker.BrokerClient):
-    def __init__(self, broker_connection, worker_number, options):
+    def __init__(self, worker_connection, worker_number, options):
         """The constructor should be used to do any simple initialization
         necessary, but should not do anything that creates data structures
         that cannot be Pickled or sent across processes (like opening
@@ -119,13 +115,16 @@
         start of the run() call.
 
         Args:
-            broker_connection - handle to the BrokerConnection object creating
+            worker_connection - handle to the BrokerConnection object creating
                 the worker and that can be used for messaging.
             worker_number - identifier for this particular worker
             options - command-line argument object from optparse"""
+        message_broker.BrokerClient.__init__(self)
+        self._worker_connection = worker_connection
+        self._options = options
+        self._worker_number = worker_number
+        self._name = 'worker/%d' % worker_number
 
-        raise NotImplementedError
-
     def run(self, port):
         """Callback for the worker to start executing. Typically does any
         remaining initialization and then calls broker_connection.run_message_loop()."""
@@ -213,7 +212,7 @@
 
 class _InlineWorkerConnection(_WorkerConnection):
     def __init__(self, broker, port, manager_client, worker_class, worker_number):
-        _WorkerConnection.__init__(self, broker, worker_class, worker_number, port._options)
+        _WorkerConnection.__init__(self, broker, worker_class, worker_number, port.options)
         self._alive = False
         self._port = port
         self._manager_client = manager_client
@@ -254,7 +253,7 @@
 
         def run(self):
             options = self._options
-            port_obj = port.get(self._platform_name, options)
+            port_obj = layout_tests.port.get(self._platform_name, options)
 
             # The unix multiprocessing implementation clones the
             # log handler configuration into the child processes,

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/message_broker.py (90795 => 90796)


--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/message_broker.py	2011-07-11 23:55:16 UTC (rev 90795)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/message_broker.py	2011-07-12 00:10:19 UTC (rev 90796)
@@ -57,13 +57,12 @@
 Broker, and Broker only invokes that reference, never talking directly to
 BrokerConnection).
 """
+import sys
+import traceback
 
 import cPickle
 import logging
 import Queue
-import sys
-import time
-import traceback
 
 from webkitpy.common.system import stack_utils
 
@@ -81,9 +80,6 @@
     src indicates the name of the sender. If the message contains values in
     the message body, those will be provided as optparams."""
 
-    def __init__(self, *optargs, **kwargs):
-        raise NotImplementedError
-
     def is_done(self):
         """Called from inside run_message_loop() to indicate whether to exit."""
         raise NotImplementedError
@@ -156,8 +152,8 @@
 
 class _Message(object):
     @staticmethod
-    def loads(str):
-        obj = cPickle.loads(str)
+    def loads(string_value):
+        obj = cPickle.loads(string_value)
         assert(isinstance(obj, _Message))
         return obj
 

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/message_broker_unittest.py (90795 => 90796)


--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/message_broker_unittest.py	2011-07-11 23:55:16 UTC (rev 90795)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/message_broker_unittest.py	2011-07-12 00:10:19 UTC (rev 90796)
@@ -65,16 +65,9 @@
     # that classes do implement every abstract method in an interface.
 
     def test_brokerclient_is_abstract(self):
-        # Test that we can't create an instance directly.
-        self.assertRaises(NotImplementedError, message_broker.BrokerClient)
-
-        class TestClient(message_broker.BrokerClient):
-            def __init__(self):
-                pass
-
         # Test that all the base class methods are abstract and have the
         # signature we expect.
-        obj = TestClient()
+        obj = message_broker.BrokerClient()
         self.assertRaises(NotImplementedError, obj.is_done)
         self.assertRaises(NotImplementedError, obj.name)
 

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py (90795 => 90796)


--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py	2011-07-11 23:55:16 UTC (rev 90795)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py	2011-07-12 00:10:19 UTC (rev 90796)
@@ -44,13 +44,16 @@
 
 class Worker(manager_worker_broker.AbstractWorker):
     def __init__(self, worker_connection, worker_number, options):
-        self._worker_connection = worker_connection
-        self._worker_number = worker_number
-        self._options = options
-        self._name = 'worker/%d' % worker_number
+        manager_worker_broker.AbstractWorker.__init__(self, worker_connection, worker_number, options)
         self._done = False
         self._canceled = False
         self._port = None
+        self._batch_size = 0
+        self._batch_count = 0
+        self._filesystem = None
+        self._driver = None
+        self._tests_run_file = None
+        self._tests_run_filename = None
 
     def __del__(self):
         self.cleanup()
@@ -62,10 +65,9 @@
         This routine exists so that the mixin can be created and then marshaled
         across into a child process."""
         self._port = port
-        self._filesystem = port._filesystem
+        self._filesystem = port.filesystem
         self._batch_count = 0
         self._batch_size = self._options.batch_size
-        self._driver = None
         tests_run_filename = self._filesystem.join(port.results_directory(),
                                                    "tests_run%d.txt" % self._worker_number)
         self._tests_run_file = self._filesystem.open_text_file_for_writing(tests_run_filename)
@@ -124,7 +126,7 @@
         # parallel with ReportCrash.
         #
         # Temporarily disabled to see how this code effect performance on the buildbots.
-        # self._port.executive().wait_newest(self._port.is_crash_reporter)
+        # self._port.executive.wait_newest(self._port.is_crash_reporter)
 
         test_timeout_sec = self.timeout(test_input)
         start = time.time()
@@ -168,9 +170,7 @@
     def run_test_with_timeout(self, test_input, timeout):
         if self._options.run_singly:
             return self._run_test_in_another_thread(test_input, timeout)
-        else:
-            return self._run_test_in_this_thread(test_input)
-        return result
+        return self._run_test_in_this_thread(test_input)
 
     def clean_up_after_test(self, test_input, result):
         self._batch_count += 1
@@ -213,17 +213,21 @@
         """
         worker = self
 
-        driver = worker._port.create_driver(worker._worker_number)
+        driver = self._port.create_driver(self._worker_number)
         driver.start()
 
         class SingleTestThread(threading.Thread):
+            def __init__(self):
+                threading.Thread.__init__(self)
+                self.result = None
+
             def run(self):
-                self.result = worker._run_single_test(driver, test_input)
+                self.result = worker.run_single_test(driver, test_input)
 
         thread = SingleTestThread()
         thread.start()
         thread.join(thread_timeout_sec)
-        result = getattr(thread, 'result', None)
+        result = thread.result
         if thread.isAlive():
             # If join() returned with the thread still running, the
             # DumpRenderTree is completely hung and there's nothing
@@ -252,8 +256,8 @@
         if not self._driver or self._driver.poll() is not None:
             self._driver = self._port.create_driver(self._worker_number)
             self._driver.start()
-        return self._run_single_test(self._driver, test_input)
+        return self.run_single_test(self._driver, test_input)
 
-    def _run_single_test(self, driver, test_input):
+    def run_single_test(self, driver, test_input):
         return single_test_runner.run_single_test(self._port, self._options,
             test_input, driver, self._name)

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py (90795 => 90796)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py	2011-07-11 23:55:16 UTC (rev 90795)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py	2011-07-12 00:10:19 UTC (rev 90796)
@@ -36,8 +36,6 @@
 import difflib
 import errno
 import os
-import sys
-import time
 
 from webkitpy.common.net.testoutputset import AggregateTestOutputSet
 
@@ -48,7 +46,6 @@
     multiprocessing = None
 
 from webkitpy.common import system
-from webkitpy.common.system import filesystem
 from webkitpy.common.system import logutils
 from webkitpy.common.system import path
 from webkitpy.common.system.executive import Executive, ScriptError
@@ -63,7 +60,6 @@
 
 _log = logutils.get_logger(__file__)
 
-
 class DummyOptions(object):
     """Fake implementation of optparse.Values. Cloned from webkitpy.tool.mocktool.MockOptions."""
 
@@ -103,13 +99,20 @@
         # FIXME: Ideally we'd have a package-wide way to get a
         # well-formed options object that had all of the necessary
         # options defined on it.
-        self._options = options or DummyOptions()
+        self.options = options or DummyOptions()
 
-        self._executive = executive or Executive()
-        self._user = user or User()
-        self._filesystem = filesystem or system.filesystem.FileSystem()
-        self._config = config or port_config.Config(self._executive, self._filesystem)
+        self.executive = executive or Executive()
+        self.user = user or User()
+        self.filesystem = filesystem or system.filesystem.FileSystem()
+        self.config = config or port_config.Config(self.executive, self.filesystem)
 
+        # FIXME: Remove all of the old "protected" versions when we can.
+        self._options = self.options
+        self._executive = self.executive
+        self._filesystem = self.filesystem
+        self._user = self.user
+        self._config = self.config
+
         self._helper = None
         self._http_server = None
         self._websocket_server = None
@@ -139,9 +142,6 @@
         self._multiprocessing_is_available = (multiprocessing is not None)
         self._results_directory = None
 
-    def executive(self):
-        return self._executive
-
     def wdiff_available(self):
         if self._wdiff_available is None:
             self._wdiff_available = self.check_wdiff(logging=False)
@@ -193,7 +193,7 @@
     def check_pretty_patch(self, logging=True):
         """Checks whether we can use the PrettyPatch ruby script."""
         try:
-            result = self._executive.run_command(['ruby', '--version'])
+            _ = self._executive.run_command(['ruby', '--version'])
         except OSError, e:
             if e.errno in [errno.ENOENT, errno.EACCES, errno.ECHILD]:
                 if logging:
@@ -215,7 +215,7 @@
             return False
 
         try:
-            result = self._executive.run_command([self._path_to_wdiff(), '--help'])
+            _ = self._executive.run_command([self._path_to_wdiff(), '--help'])
         except OSError:
             if logging:
                 _log.error("wdiff is not installed.")
@@ -225,14 +225,14 @@
 
     def check_httpd(self):
         if self._uses_apache():
-            path = self._path_to_apache()
+            httpd_path = self._path_to_apache()
         else:
-            path = self._path_to_lighttpd()
+            httpd_path = self._path_to_lighttpd()
 
         try:
             env = self.setup_environ_for_server()
-            return self._executive.run_command([path, "-v"], env=env, return_exit_code=True) == 0
-        except OSError, e:
+            return self._executive.run_command([httpd_path, "-v"], env=env, return_exit_code=True) == 0
+        except OSError:
             _log.error("No httpd found. Cannot run http tests.")
             return False
 
@@ -269,10 +269,10 @@
         # The filenames show up in the diff output, make sure they're
         # raw bytes and not unicode, so that they don't trigger join()
         # trying to decode the input.
-        def to_raw_bytes(str):
-            if isinstance(str, unicode):
-                return str.encode('utf-8')
-            return str
+        def to_raw_bytes(string_value):
+            if isinstance(string_value, unicode):
+                return string_value.encode('utf-8')
+            return string_value
         expected_filename = to_raw_bytes(expected_filename)
         actual_filename = to_raw_bytes(actual_filename)
         diff = difflib.unified_diff(expected_text.splitlines(True),
@@ -377,16 +377,16 @@
 
     def expected_image(self, test_name):
         """Returns the image we expect the test to produce."""
-        path = self.expected_filename(test_name, '.png')
-        if not self._filesystem.exists(path):
+        baseline_path = self.expected_filename(test_name, '.png')
+        if not self._filesystem.exists(baseline_path):
             return None
-        return self._filesystem.read_binary_file(path)
+        return self._filesystem.read_binary_file(baseline_path)
 
     def expected_audio(self, test_name):
-        path = self.expected_filename(test_name, '.wav')
-        if not self._filesystem.exists(path):
+        baseline_path = self.expected_filename(test_name, '.wav')
+        if not self._filesystem.exists(baseline_path):
             return None
-        return self._filesystem.read_binary_file(path)
+        return self._filesystem.read_binary_file(baseline_path)
 
     def expected_text(self, test_name):
         """Returns the text output we expect the test to produce, or None
@@ -395,12 +395,12 @@
         # FIXME: DRT output is actually utf-8, but since we don't decode the
         # output from DRT (instead treating it as a binary string), we read the
         # baselines as a binary string, too.
-        path = self.expected_filename(test_name, '.txt')
-        if not self._filesystem.exists(path):
-            path = self.expected_filename(test_name, '.webarchive')
-            if not self._filesystem.exists(path):
+        baseline_path = self.expected_filename(test_name, '.txt')
+        if not self._filesystem.exists(baseline_path):
+            baseline_path = self.expected_filename(test_name, '.webarchive')
+            if not self._filesystem.exists(baseline_path):
                 return None
-        text = self._filesystem.read_binary_file(path)
+        text = self._filesystem.read_binary_file(baseline_path)
         return text.replace("\r\n", "\n")
 
     def reftest_expected_filename(self, test_name):
@@ -417,7 +417,6 @@
         LAYOUTTEST_WEBSOCKET_DIR = "http/tests/websocket/tests/"
 
         port = None
-        use_ssl = False
 
         relative_path = test_name
         if (relative_path.startswith(LAYOUTTEST_WEBSOCKET_DIR)
@@ -453,15 +452,15 @@
     def test_isdir(self, test_name):
         """Return True if the test name refers to a directory of tests."""
         # Used by test_expectations.py to apply rules to whole directories.
-        path = self.abspath_for_test(test_name)
-        return self._filesystem.isdir(path)
+        test_path = self.abspath_for_test(test_name)
+        return self._filesystem.isdir(test_path)
 
     def test_exists(self, test_name):
         """Return True if the test name refers to an existing test or baseline."""
         # Used by test_expectations.py to determine if an entry refers to a
         # valid test and by printing.py to determine if baselines exist.
-        path = self.abspath_for_test(test_name)
-        return self._filesystem.exists(path)
+        test_path = self.abspath_for_test(test_name)
+        return self._filesystem.exists(test_path)
 
     def split_test(self, test_name):
         """Splits a test name into the 'directory' part and the 'basename' part."""
@@ -481,16 +480,16 @@
         driver = self.create_driver(0)
         return driver.cmd_line()
 
-    def update_baseline(self, path, data):
+    def update_baseline(self, baseline_path, data):
         """Updates the baseline for a test.
 
         Args:
-            path: the actual path to use for baseline, not the path to
+            baseline_path: the actual path to use for baseline, not the path to
               the test. This function is used to update either generic or
               platform-specific baselines, but we can't infer which here.
             data: contents of the baseline.
         """
-        self._filesystem.write_binary_file(path, data)
+        self._filesystem.write_binary_file(baseline_path, data)
 
     def uri_to_test_name(self, uri):
         """Return the base layout test name for a given URI.
@@ -522,6 +521,9 @@
         """Return the absolute path to the top of the LayoutTests directory."""
         return self.path_from_webkit_base('LayoutTests')
 
+    def skipped_layout_tests(self):
+        return []
+
     def skips_layout_test(self, test_name):
         """Figures out if the givent test is being skipped or not.
 
@@ -536,9 +538,9 @@
                 return True
         return False
 
-    def maybe_make_directory(self, *path):
+    def maybe_make_directory(self, *comps):
         """Creates the specified directory if it doesn't already exist."""
-        self._filesystem.maybe_make_directory(*path)
+        self._filesystem.maybe_make_directory(*comps)
 
     def name(self):
         """Returns a name that uniquely identifies this particular type of port
@@ -921,7 +923,7 @@
     def __init__(self, port=None, version=None, architecture=None, build_type=None, graphics_type=None):
         self.version = version or port.version()
         self.architecture = architecture or port.architecture()
-        self.build_type = build_type or port._options.configuration.lower()
+        self.build_type = build_type or port.options.configuration.lower()
         self.graphics_type = graphics_type or port.graphics_type()
 
     def items(self):
@@ -946,12 +948,12 @@
         # By default, we assume we want to test every graphics type in
         # every configuration on every system.
         test_configurations = []
-        for system in self.all_systems():
+        for version, architecture in self.all_systems():
             for build_type in self.all_build_types():
                 for graphics_type in self.all_graphics_types():
                     test_configurations.append(TestConfiguration(
-                        version=system[0],
-                        architecture=system[1],
+                        version=version,
+                        architecture=architecture,
                         build_type=build_type,
                         graphics_type=graphics_type))
         return test_configurations

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py (90795 => 90796)


--- trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py	2011-07-11 23:55:16 UTC (rev 90795)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py	2011-07-12 00:10:19 UTC (rev 90796)
@@ -38,17 +38,12 @@
 import signal
 import sys
 
-from webkitpy.common.net import resultsjsonparser
-from webkitpy.layout_tests import layout_package
+from webkitpy import layout_tests
+
 from webkitpy.layout_tests.controllers.manager import Manager, WorkerException
-from webkitpy.layout_tests.layout_package import json_results_generator
 from webkitpy.layout_tests.views import printing
 
-from webkitpy.common.system import user
-from webkitpy.thirdparty import simplejson
 
-import port
-
 _log = logging.getLogger(__name__)
 
 
@@ -86,7 +81,7 @@
     num_unexpected_results = -1
     try:
         manager = Manager(port, options, printer)
-        manager._print_config()
+        manager.print_config()
 
         printer.print_update("Collecting tests ...")
         try:
@@ -119,13 +114,13 @@
     return num_unexpected_results
 
 
-def _set_up_derived_options(port_obj, options):
+def _set_up_derived_options(port, options):
     """Sets the options values that depend on other options values."""
     # We return a list of warnings to print after the printer is initialized.
     warnings = []
 
     if options.worker_model is None:
-        options.worker_model = port_obj.default_worker_model()
+        options.worker_model = port.default_worker_model()
 
     if options.worker_model == 'inline':
         if options.child_processes and int(options.child_processes) > 1:
@@ -133,10 +128,10 @@
         options.child_processes = "1"
     if not options.child_processes:
         options.child_processes = os.environ.get("WEBKIT_TEST_CHILD_PROCESSES",
-                                                 str(port_obj.default_child_processes()))
+                                                 str(port.default_child_processes()))
 
     if not options.configuration:
-        options.configuration = port_obj.default_configuration()
+        options.configuration = port.default_configuration()
 
     if options.pixel_tests is None:
         options.pixel_tests = True
@@ -152,10 +147,10 @@
     if options.additional_platform_directory:
         normalized_platform_directories = []
         for path in options.additional_platform_directory:
-            if not port_obj._filesystem.isabs(path):
+            if not port.filesystem.isabs(path):
                 warnings.append("--additional-platform-directory=%s is ignored since it is not absolute" % path)
                 continue
-            normalized_platform_directories.append(port_obj._filesystem.normpath(path))
+            normalized_platform_directories.append(port.filesystem.normpath(path))
         options.additional_platform_directory = normalized_platform_directories
 
     return warnings
@@ -429,8 +424,8 @@
 
 def main():
     options, args = parse_args()
-    port_obj = port.get(options.platform, options)
-    return run(port_obj, options, args)
+    port = layout_tests.port.get(options.platform, options)
+    return run(port, options, args)
 
 
 if '__main__' == __name__:
@@ -440,7 +435,7 @@
         # This mirrors what the shell normally does.
         INTERRUPTED_EXIT_STATUS = signal.SIGINT + 128
         sys.exit(INTERRUPTED_EXIT_STATUS)
-    except WorkerException, e:
+    except WorkerException:
         # This is a randomly chosen exit code that can be tested against to
         # indicate that an unexpected exception occurred.
         EXCEPTIONAL_EXIT_STATUS = 254
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to