Title: [107273] trunk/Tools
Revision
107273
Author
[email protected]
Date
2012-02-09 12:18:48 -0800 (Thu, 09 Feb 2012)

Log Message

[Qt][WK2] run-webkit-tests --qt  crashes if WEBKIT_TESTFONTS is not set
https://bugs.webkit.org/show_bug.cgi?id=77466

Patch by Jesus Sanchez-Palencia <[email protected]> on 2012-02-09
Reviewed by Dirk Pranke.

Replicate the behavior of old-run-webkit-tests and check if WEBKIT_TESTFONTS
is set or if we should raise an error. A unit test was added.

* Scripts/webkitpy/layout_tests/port/qt.py:
(QtPort.operating_system):
(QtPort):
(QtPort.check_sys_deps):
* Scripts/webkitpy/layout_tests/port/qt_unittest.py:
(QtPortTest.test_operating_system):
(QtPortTest):
(QtPortTest.test_check_sys_deps):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (107272 => 107273)


--- trunk/Tools/ChangeLog	2012-02-09 20:11:48 UTC (rev 107272)
+++ trunk/Tools/ChangeLog	2012-02-09 20:18:48 UTC (rev 107273)
@@ -1,3 +1,22 @@
+2012-02-09  Jesus Sanchez-Palencia  <[email protected]>
+
+        [Qt][WK2] run-webkit-tests --qt  crashes if WEBKIT_TESTFONTS is not set
+        https://bugs.webkit.org/show_bug.cgi?id=77466
+
+        Reviewed by Dirk Pranke.
+
+        Replicate the behavior of old-run-webkit-tests and check if WEBKIT_TESTFONTS
+        is set or if we should raise an error. A unit test was added.
+
+        * Scripts/webkitpy/layout_tests/port/qt.py:
+        (QtPort.operating_system):
+        (QtPort):
+        (QtPort.check_sys_deps):
+        * Scripts/webkitpy/layout_tests/port/qt_unittest.py:
+        (QtPortTest.test_operating_system):
+        (QtPortTest):
+        (QtPortTest.test_check_sys_deps):
+
 2012-02-09  Eric Seidel  <[email protected]>
 
         Rename ports.WebKitPort to DeprecatedPort and make it stop being all class methods

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/qt.py (107272 => 107273)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/qt.py	2012-02-09 20:11:48 UTC (rev 107272)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/qt.py	2012-02-09 20:18:48 UTC (rev 107273)
@@ -31,6 +31,7 @@
 import logging
 import re
 import sys
+import os
 
 import webkit
 
@@ -148,3 +149,12 @@
 
     def operating_system(self):
         return self._operating_system
+
+    def check_sys_deps(self, needs_http):
+        result = super(QtPort, self).check_sys_deps(needs_http)
+        if not 'WEBKIT_TESTFONTS' in os.environ:
+            _log.error('\nThe WEBKIT_TESTFONTS environment variable is not defined or not set properly.')
+            _log.error('You must set it before running the tests.')
+            _log.error('Use git to grab the actual fonts from http://gitorious.org/qtwebkit/testfonts')
+            return False
+        return result

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/qt_unittest.py (107272 => 107273)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/qt_unittest.py	2012-02-09 20:11:48 UTC (rev 107272)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/qt_unittest.py	2012-02-09 20:18:48 UTC (rev 107273)
@@ -27,6 +27,7 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 import unittest
+import os
 
 from webkitpy.common.system.executive_mock import MockExecutive, MockExecutive2
 from webkitpy.common.system.outputcapture import OutputCapture
@@ -86,3 +87,17 @@
         self.assertEqual('linux', self.make_port(port_name='qt-linux', os_name='linux').operating_system())
         self.assertEqual('mac', self.make_port(os_name='mac').operating_system())
         self.assertEqual('win', self.make_port(port_name='qt-win', os_name='win').operating_system())
+
+    def test_check_sys_deps(self):
+        port = self.make_port()
+
+        # Success
+        os.environ['WEBKIT_TESTFONTS'] = '/tmp/foo'
+        port._executive = MockExecutive2(exit_code=0)
+        self.assertTrue(port.check_sys_deps(needs_http=False))
+
+        # Failure
+        del os.environ['WEBKIT_TESTFONTS']
+        port._executive = MockExecutive2(exit_code=1,
+            output='testing output failure')
+        self.assertFalse(port.check_sys_deps(needs_http=False))
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to