[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

dpranke at chromium.org dpranke at chromium.org
Wed Dec 22 16:14:58 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 9575c957d482b8613154be3cf8ad8c0bcd093fd1
Author: dpranke at chromium.org <dpranke at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Nov 20 01:39:32 2010 +0000

    2010-11-19  Dirk Pranke  <dpranke at chromium.org>
    
            Reviewed by Ojan Vafai.
    
            nrwt - config.build_directory() is busted
    
            Fixes a typo that was causing us to usually return the top level
            directory WebKitBuild instead of WebKitBuild/{Debug,Release}. The
            bug was hidden by test stubs that were too simplistic :(.
    
            https://bugs.webkit.org/show_bug.cgi?id=49815
    
            * Scripts/webkitpy/common/system/executive_mock.py:
            * Scripts/webkitpy/layout_tests/port/config.py:
            * Scripts/webkitpy/layout_tests/port/config_unittest.py:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72455 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 8ade104..853ee0a 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,19 @@
+2010-11-19  Dirk Pranke  <dpranke at chromium.org>
+
+        Reviewed by Ojan Vafai.
+
+        nrwt - config.build_directory() is busted
+
+        Fixes a typo that was causing us to usually return the top level
+        directory WebKitBuild instead of WebKitBuild/{Debug,Release}. The
+        bug was hidden by test stubs that were too simplistic :(.
+
+        https://bugs.webkit.org/show_bug.cgi?id=49815
+
+        * Scripts/webkitpy/common/system/executive_mock.py:
+        * Scripts/webkitpy/layout_tests/port/config.py:
+        * Scripts/webkitpy/layout_tests/port/config_unittest.py:
+
 2010-11-19  Steve Falkenburg  <sfalken at apple.com>
 
         Reviewed by Adam Roben.
diff --git a/WebKitTools/Scripts/webkitpy/common/system/executive_mock.py b/WebKitTools/Scripts/webkitpy/common/system/executive_mock.py
index 7347ff9..c1cf999 100644
--- a/WebKitTools/Scripts/webkitpy/common/system/executive_mock.py
+++ b/WebKitTools/Scripts/webkitpy/common/system/executive_mock.py
@@ -32,10 +32,12 @@
 
 
 class MockExecutive2(object):
-    def __init__(self, output='', exit_code=0, exception=None):
+    def __init__(self, output='', exit_code=0, exception=None,
+                 run_command_fn=None):
         self._output = output
         self._exit_code = exit_code
         self._exception = exception
+        self._run_command_fn = run_command_fn
 
     def cpu_count(self):
         return 2
@@ -52,4 +54,6 @@ class MockExecutive2(object):
             raise self._exception
         if return_exit_code:
             return self._exit_code
+        if self._run_command_fn:
+            return self._run_command_fn(arg_list)
         return self._output
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/config.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/config.py
index cad5e37..9aec637 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/config.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/config.py
@@ -75,7 +75,6 @@ class Config(object):
         if configuration:
             flags = ["--configuration",
                      self._FLAGS_FROM_CONFIGURATIONS[configuration]]
-            configuration = ""
         else:
             configuration = ""
             flags = ["--top-level"]
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/config_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/config_unittest.py
index 9bea014..2d23691 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/config_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/config_unittest.py
@@ -38,13 +38,37 @@ from webkitpy.common.system import outputcapture
 
 import config
 
+
+def mock_run_command(arg_list):
+    # Set this to True to test actual output (where possible).
+    integration_test = False
+    if integration_test:
+        return executive.Executive().run_command(arg_list)
+
+    if 'webkit-build-directory' in arg_list[1]:
+        return mock_webkit_build_directory(arg_list[2:])
+    return 'Error'
+
+
+def mock_webkit_build_directory(arg_list):
+    if arg_list == ['--top-level']:
+        return '/WebKitBuild'
+    elif arg_list == ['--configuration', '--debug']:
+        return '/WebKitBuild/Debug'
+    elif arg_list == ['--configuration', '--release']:
+        return '/WebKitBuild/Release'
+    return 'Error'
+
+
 class ConfigTest(unittest.TestCase):
     def tearDown(self):
         config.clear_cached_configuration()
 
-    def make_config(self, output='', files={}, exit_code=0, exception=None):
+    def make_config(self, output='', files={}, exit_code=0, exception=None,
+                    run_command_fn=None):
         e = executive_mock.MockExecutive2(output=output, exit_code=exit_code,
-                                          exception=exception)
+                                          exception=exception,
+                                          run_command_fn=run_command_fn)
         fs = filesystem_mock.MockFileSystem(files)
         return config.Config(e, fs)
 
@@ -54,23 +78,17 @@ class ConfigTest(unittest.TestCase):
         c = self.make_config('foo', {'foo/Configuration': contents})
         self.assertEqual(c.default_configuration(), expected)
 
-    def test_build_directory_toplevel(self):
-        c = self.make_config('toplevel')
-        self.assertEqual(c.build_directory(None), 'toplevel')
+    def test_build_directory(self):
+        # --top-level
+        c = self.make_config(run_command_fn=mock_run_command)
+        self.assertTrue(c.build_directory(None).endswith('WebKitBuild'))
 
         # Test again to check caching
-        self.assertEqual(c.build_directory(None), 'toplevel')
-
-    def test_build_directory__release(self):
-        c = self.make_config('release')
-        self.assertEqual(c.build_directory('Release'), 'release')
-
-    def test_build_directory__debug(self):
-        c = self.make_config('debug')
-        self.assertEqual(c.build_directory('Debug'), 'debug')
+        self.assertTrue(c.build_directory(None).endswith('WebKitBuild'))
 
-    def test_build_directory__unknown(self):
-        c = self.make_config("unknown")
+        # Test other values
+        self.assertTrue(c.build_directory('Release').endswith('/Release'))
+        self.assertTrue(c.build_directory('Debug').endswith('/Debug'))
         self.assertRaises(KeyError, c.build_directory, 'Unknown')
 
     def test_build_dumprendertree__success(self):

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list