[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198
tony at chromium.org
tony at chromium.org
Sun Feb 20 23:16:55 UTC 2011
The following commit has been merged in the webkit-1.3 branch:
commit 77a68c2c8c0a05449741e9c8fcf195b00520c494
Author: tony at chromium.org <tony at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Jan 19 18:14:29 2011 +0000
2011-01-19 Tony Chang <tony at chromium.org>
Reviewed by Mihai Parparita.
[chromium] [linux] if check-sys-deps fails, output the failure reason
https://bugs.webkit.org/show_bug.cgi?id=52671
* Scripts/webkitpy/common/system/executive_mock.py: Add support for
error handler functions.
* Scripts/webkitpy/layout_tests/port/chromium.py:
output the error text from --check-sys-deps
* Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76134 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index 70dbef3..774b239 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,3 +1,16 @@
+2011-01-19 Tony Chang <tony at chromium.org>
+
+ Reviewed by Mihai Parparita.
+
+ [chromium] [linux] if check-sys-deps fails, output the failure reason
+ https://bugs.webkit.org/show_bug.cgi?id=52671
+
+ * Scripts/webkitpy/common/system/executive_mock.py: Add support for
+ error handler functions.
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ output the error text from --check-sys-deps
+ * Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
+
2011-01-19 Aparna Nandyal <aparna.nand at wipro.com>
Reviewed by Andreas Kling.
diff --git a/Tools/Scripts/webkitpy/common/system/executive_mock.py b/Tools/Scripts/webkitpy/common/system/executive_mock.py
index c1cf999..943b70c 100644
--- a/Tools/Scripts/webkitpy/common/system/executive_mock.py
+++ b/Tools/Scripts/webkitpy/common/system/executive_mock.py
@@ -30,6 +30,8 @@
# FIXME: Unify with tool/mocktool.MockExecutive.
+from webkitpy.common.system import executive
+
class MockExecutive2(object):
def __init__(self, output='', exit_code=0, exception=None,
@@ -48,7 +50,7 @@ class MockExecutive2(object):
def kill_process(self, pid):
pass
- def run_command(self, arg_list, return_exit_code=False,
+ def run_command(self, arg_list, error_handler=None, return_exit_code=False,
decode_output=False):
if self._exception:
raise self._exception
@@ -56,4 +58,10 @@ class MockExecutive2(object):
return self._exit_code
if self._run_command_fn:
return self._run_command_fn(arg_list)
+ if self._exit_code and error_handler:
+ script_error = executive.ScriptError(script_args=arg_list,
+ exit_code=self._exit_code,
+ output=self._output)
+ error_handler(script_error)
+
return self._output
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
index 7e934a8..9aa0946 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
@@ -44,6 +44,7 @@ import tempfile
import time
import webbrowser
+from webkitpy.common.system import executive
from webkitpy.common.system.path import cygpath
from webkitpy.layout_tests.layout_package import test_expectations
from webkitpy.layout_tests.layout_package import test_output
@@ -120,10 +121,18 @@ class ChromiumPort(base.Port):
def check_sys_deps(self, needs_http):
cmd = [self._path_to_driver(), '--check-layout-test-sys-deps']
- if self._executive.run_command(cmd, return_exit_code=True):
+
+ local_error = executive.ScriptError()
+
+ def error_handler(script_error):
+ local_error.exit_code = script_error.exit_code
+
+ output = self._executive.run_command(cmd, error_handler=error_handler)
+ if local_error.exit_code:
_log.error('System dependencies check failed.')
_log.error('To override, invoke with --nocheck-sys-deps')
_log.error('')
+ _log.error(output)
return False
return True
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py
index c87984f..43bfbd4 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py
@@ -30,6 +30,8 @@ import os
import unittest
import StringIO
+from webkitpy.common.system import logtesting
+from webkitpy.common.system import executive_mock
from webkitpy.tool import mocktool
from webkitpy.thirdparty.mock import Mock
@@ -153,35 +155,19 @@ LINUX WIN : fast/js/very-good.js = TIMEOUT PASS"""
def _path_to_image_diff(self):
return "/path/to/image_diff"
- class MockExecute:
- def __init__(self, result):
- self._result = result
-
- def run_command(self,
- args,
- cwd=None,
- input=None,
- error_handler=None,
- return_exit_code=False,
- return_stderr=True,
- decode_output=False):
- if return_exit_code:
- return self._result
- return ''
-
mock_options = mocktool.MockOptions()
port = ChromiumPortTest.TestLinuxPort(mock_options)
# Images are different.
- port._executive = MockExecute(0)
+ port._executive = executive_mock.MockExecutive2(exit_code=0)
self.assertEquals(False, port.diff_image("EXPECTED", "ACTUAL"))
# Images are the same.
- port._executive = MockExecute(1)
+ port._executive = executive_mock.MockExecutive2(exit_code=1)
self.assertEquals(True, port.diff_image("EXPECTED", "ACTUAL"))
# There was some error running image_diff.
- port._executive = MockExecute(2)
+ port._executive = executive_mock.MockExecutive2(exit_code=2)
exception_raised = False
try:
port.diff_image("EXPECTED", "ACTUAL")
@@ -189,5 +175,25 @@ LINUX WIN : fast/js/very-good.js = TIMEOUT PASS"""
exception_raised = True
self.assertFalse(exception_raised)
+
+class ChromiumPortLoggingTest(logtesting.LoggingTestCase):
+ def test_check_sys_deps(self):
+ mock_options = mocktool.MockOptions()
+ port = ChromiumPortTest.TestLinuxPort(options=mock_options)
+
+ # Success
+ port._executive = executive_mock.MockExecutive2(exit_code=0)
+ self.assertTrue(port.check_sys_deps(needs_http=False))
+
+ # Failure
+ port._executive = executive_mock.MockExecutive2(exit_code=1,
+ output='testing output failure')
+ self.assertFalse(port.check_sys_deps(needs_http=False))
+ self.assertLog([
+ 'ERROR: System dependencies check failed.\n',
+ 'ERROR: To override, invoke with --nocheck-sys-deps\n',
+ 'ERROR: \n',
+ 'ERROR: testing output failure\n'])
+
if __name__ == '__main__':
unittest.main()
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list