Changeset 107273 in webkit


Ignore:
Timestamp:
Feb 9, 2012 12:18:48 PM (12 years ago)
Author:
commit-queue@webkit.org
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 <jesus.palencia@openbossa.org> 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):

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r107271 r107273  
     12012-02-09  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
     2
     3        [Qt][WK2] run-webkit-tests --qt  crashes if WEBKIT_TESTFONTS is not set
     4        https://bugs.webkit.org/show_bug.cgi?id=77466
     5
     6        Reviewed by Dirk Pranke.
     7
     8        Replicate the behavior of old-run-webkit-tests and check if WEBKIT_TESTFONTS
     9        is set or if we should raise an error. A unit test was added.
     10
     11        * Scripts/webkitpy/layout_tests/port/qt.py:
     12        (QtPort.operating_system):
     13        (QtPort):
     14        (QtPort.check_sys_deps):
     15        * Scripts/webkitpy/layout_tests/port/qt_unittest.py:
     16        (QtPortTest.test_operating_system):
     17        (QtPortTest):
     18        (QtPortTest.test_check_sys_deps):
     19
    1202012-02-09  Eric Seidel  <eric@webkit.org>
    221
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/qt.py

    r106466 r107273  
    3232import re
    3333import sys
     34import os
    3435
    3536import webkit
     
    149150    def operating_system(self):
    150151        return self._operating_system
     152
     153    def check_sys_deps(self, needs_http):
     154        result = super(QtPort, self).check_sys_deps(needs_http)
     155        if not 'WEBKIT_TESTFONTS' in os.environ:
     156            _log.error('\nThe WEBKIT_TESTFONTS environment variable is not defined or not set properly.')
     157            _log.error('You must set it before running the tests.')
     158            _log.error('Use git to grab the actual fonts from http://gitorious.org/qtwebkit/testfonts')
     159            return False
     160        return result
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/qt_unittest.py

    r104843 r107273  
    2828
    2929import unittest
     30import os
    3031
    3132from webkitpy.common.system.executive_mock import MockExecutive, MockExecutive2
     
    8788        self.assertEqual('mac', self.make_port(os_name='mac').operating_system())
    8889        self.assertEqual('win', self.make_port(port_name='qt-win', os_name='win').operating_system())
     90
     91    def test_check_sys_deps(self):
     92        port = self.make_port()
     93
     94        # Success
     95        os.environ['WEBKIT_TESTFONTS'] = '/tmp/foo'
     96        port._executive = MockExecutive2(exit_code=0)
     97        self.assertTrue(port.check_sys_deps(needs_http=False))
     98
     99        # Failure
     100        del os.environ['WEBKIT_TESTFONTS']
     101        port._executive = MockExecutive2(exit_code=1,
     102            output='testing output failure')
     103        self.assertFalse(port.check_sys_deps(needs_http=False))
Note: See TracChangeset for help on using the changeset viewer.