Diff
Modified: trunk/Tools/ChangeLog (172829 => 172830)
--- trunk/Tools/ChangeLog 2014-08-21 12:29:37 UTC (rev 172829)
+++ trunk/Tools/ChangeLog 2014-08-21 15:47:21 UTC (rev 172830)
@@ -1,3 +1,37 @@
+2014-08-21 Carlos Alberto Lopez Perez <[email protected]>
+
+ [GTK] Load the llvmpipe (Mesa) libraries when running the tests with Xvfb.
+ https://bugs.webkit.org/show_bug.cgi?id=134070
+
+ Reviewed by Martin Robinson.
+
+ * Scripts/webkitpy/port/base.py:
+ (Port.__init__): Set default _jhbuild_wrapper variable.
+ (Port._should_use_jhbuild): Implement generic check.
+ * Scripts/webkitpy/port/efl.py: Rename to jhbuild_wrapper variable
+ to make it consistent with the other ports.
+ * Scripts/webkitpy/port/gtk.py:
+ (GtkPort.__init__): Use the new _should_use_jhbuild() method.
+ (GtkPort.setup_environ_for_server): Get the path for llvmpipe_libgl_path by
+ querying the jhbuild with printenv. Also check that the path contains
+ the libraries we expect. Preload this path only for XvfbDriver.
+ * Scripts/webkitpy/port/xvfbdriver.py:
+ (XvfbDriver.check_driver): Check for the jhbuild wrapper and use it.
+ (XvfbDriver._start): The environment for llvmpipe_libgl_path is now
+ configured at setup_environ_for_server()
+ * Scripts/webkitpy/port/xvfbdriver_unittest.py:
+ (XvfbDriverTest.make_driver): Get the port default environment.
+ (XvfbDriverTest.test_start_no_pixel_tests): The expected log now
+ should include the environment that is passed when running Xvfb.
+ (XvfbDriverTest.test_start_pixel_tests): Ditto.
+ (XvfbDriverTest.test_start_arbitrary_worker_number): Ditto.
+ (XvfbDriverTest.test_start_next_worker): Ditto.
+ * gtk/jhbuild.modules: Rename checkoutdir to generic "Mesa" to
+ prevent future problems when the version is raised. Add also a
+ comment with a warning.
+ * gtk/jhbuildrc: The path LLVMPIPE_LIBGL_PATH should be the one
+ that has the llvm optimized Gallium libGL libraries.
+
2014-08-21 Renato Nagy <[email protected]>
Fix countFailures of RunLLINTCLoopTests and Run32bitJSCTests.
Modified: trunk/Tools/Scripts/webkitpy/port/base.py (172829 => 172830)
--- trunk/Tools/Scripts/webkitpy/port/base.py 2014-08-21 12:29:37 UTC (rev 172829)
+++ trunk/Tools/Scripts/webkitpy/port/base.py 2014-08-21 15:47:21 UTC (rev 172830)
@@ -132,6 +132,7 @@
self._reftest_list = {}
self._results_directory = None
self._root_was_set = hasattr(options, 'root') and options.root
+ self._jhbuild_wrapper = []
def additional_drt_flag(self):
return []
@@ -1267,6 +1268,9 @@
# --pixel-test-directory is not specified.
return True
+ def _should_use_jhbuild(self):
+ return os.path.exists(self.path_from_webkit_base('WebKitBuild', 'Dependencies'))
+
# FIXME: Eventually we should standarize port naming, and make this method smart enough
# to use for all port configurations (including architectures, graphics types, etc).
def _port_flag_for_scripts(self):
Modified: trunk/Tools/Scripts/webkitpy/port/efl.py (172829 => 172830)
--- trunk/Tools/Scripts/webkitpy/port/efl.py 2014-08-21 12:29:37 UTC (rev 172829)
+++ trunk/Tools/Scripts/webkitpy/port/efl.py 2014-08-21 15:47:21 UTC (rev 172830)
@@ -42,9 +42,9 @@
def __init__(self, *args, **kwargs):
super(EflPort, self).__init__(*args, **kwargs)
- self._jhbuild_wrapper_path = [self.path_from_webkit_base('Tools', 'jhbuild', 'jhbuild-wrapper'), '--efl', 'run']
+ self._jhbuild_wrapper = [self.path_from_webkit_base('Tools', 'jhbuild', 'jhbuild-wrapper'), '--efl', 'run']
- self.set_option_default('wrapper', ' '.join(self._jhbuild_wrapper_path))
+ self.set_option_default('wrapper', ' '.join(self._jhbuild_wrapper))
self.webprocess_cmd_prefix = self.get_option('webprocess_cmd_prefix')
self._pulseaudio_sanitizer = PulseAudioSanitizer()
@@ -101,7 +101,7 @@
return self._build_path('bin', 'ImageDiff')
def _image_diff_command(self, *args, **kwargs):
- return self._jhbuild_wrapper_path + super(EflPort, self)._image_diff_command(*args, **kwargs)
+ return self._jhbuild_wrapper + super(EflPort, self)._image_diff_command(*args, **kwargs)
def _path_to_webcore_library(self):
static_path = self._build_path('lib', 'libwebcore_efl.a')
Modified: trunk/Tools/Scripts/webkitpy/port/gtk.py (172829 => 172830)
--- trunk/Tools/Scripts/webkitpy/port/gtk.py 2014-08-21 12:29:37 UTC (rev 172829)
+++ trunk/Tools/Scripts/webkitpy/port/gtk.py 2014-08-21 15:47:21 UTC (rev 172830)
@@ -30,6 +30,7 @@
import os
import subprocess
import uuid
+import logging
from webkitpy.common.memoized import memoized
from webkitpy.layout_tests.models.test_configuration import TestConfiguration
@@ -41,6 +42,7 @@
from webkitpy.port.linux_get_crash_log import GDBCrashLogGenerator
from webkitpy.port.leakdetector_valgrind import LeakDetectorValgrind
+_log = logging.getLogger(__name__)
class GtkPort(Port):
port_name = "gtk"
@@ -54,7 +56,7 @@
if not self.get_option("wrapper"):
raise ValueError('use --wrapper=\"valgrind\" for memory leak detection on GTK')
- if os.path.exists(self.path_from_webkit_base('WebKitBuild', 'Dependencies')):
+ if self._should_use_jhbuild():
self._jhbuild_wrapper = [self.path_from_webkit_base('Tools', 'jhbuild', 'jhbuild-wrapper'), '--gtk', 'run']
if self.get_option('wrapper'):
self.set_option('wrapper', ' '.join(self._jhbuild_wrapper) + ' ' + self.get_option('wrapper'))
@@ -113,6 +115,16 @@
environment['TEST_RUNNER_INJECTED_BUNDLE_FILENAME'] = self._build_path('lib', 'libTestRunnerInjectedBundle.so')
environment['TEST_RUNNER_TEST_PLUGIN_PATH'] = self._build_path('lib')
self._copy_value_from_environ_if_set(environment, 'WEBKIT_OUTPUTDIR')
+ if self._driver_class() == XvfbDriver and self._should_use_jhbuild():
+ llvmpipe_libgl_path = self.host.executive.run_command(self._jhbuild_wrapper + ['printenv', 'LLVMPIPE_LIBGL_PATH'],
+ error_handler=self.host.executive.ignore_error).strip()
+ if os.path.exists(os.path.join(llvmpipe_libgl_path, "libGL.so")):
+ # Force the Gallium llvmpipe software rasterizer
+ environment['LD_LIBRARY_PATH'] = llvmpipe_libgl_path
+ if os.environ.get('LD_LIBRARY_PATH'):
+ environment['LD_LIBRARY_PATH'] += ':%s' % os.environ.get('LD_LIBRARY_PATH')
+ else:
+ _log.warning("Can't find Gallium llvmpipe driver. Try to run update-webkitgtk-libs")
if self.get_option("leaks"):
# Turn off GLib memory optimisations https://wiki.gnome.org/Valgrind.
environment['G_SLICE'] = 'always-malloc'
Modified: trunk/Tools/Scripts/webkitpy/port/xvfbdriver.py (172829 => 172830)
--- trunk/Tools/Scripts/webkitpy/port/xvfbdriver.py 2014-08-21 12:29:37 UTC (rev 172829)
+++ trunk/Tools/Scripts/webkitpy/port/xvfbdriver.py 2014-08-21 15:47:21 UTC (rev 172830)
@@ -1,4 +1,5 @@
# Copyright (C) 2010 Google Inc. All rights reserved.
+# Copyright (C) 2014 Igalia S.L.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -41,7 +42,10 @@
class XvfbDriver(Driver):
@staticmethod
def check_driver(port):
- xvfb_found = port.host.executive.run_command(['which', 'Xvfb'], return_exit_code=True) is 0
+ xvfb_findcmd = ['which', 'Xvfb']
+ if port._should_use_jhbuild():
+ xvfb_findcmd = port._jhbuild_wrapper + xvfb_findcmd
+ xvfb_found = port.host.executive.run_command(xvfb_findcmd, return_exit_code=True) is 0
if not xvfb_found:
_log.error("No Xvfb found. Cannot run layout tests.")
return xvfb_found
@@ -80,13 +84,13 @@
server_name = self._port.driver_name()
environment = self._port.setup_environ_for_server(server_name)
- llvmpipe_libgl_path = os.environ.get('LLVMPIPE_LIBGL_PATH')
- if llvmpipe_libgl_path:
- environment['LD_LIBRARY_PATH'] = '%s:%s' % (llvmpipe_libgl_path, os.environ.get('LD_LIBRARY_PATH', ''))
+ run_xvfb = ["Xvfb", ":%d" % display_id, "-screen", "0", "1024x768x%s" % self._xvfb_screen_depth(), "-nolisten", "tcp"]
- run_xvfb = ["Xvfb", ":%d" % display_id, "-screen", "0", "1024x768x%s" % self._xvfb_screen_depth(), "-nolisten", "tcp"]
+ if self._port._should_use_jhbuild():
+ run_xvfb = self._port._jhbuild_wrapper + run_xvfb
+
with open(os.devnull, 'w') as devnull:
- self._xvfb_process = self._port.host.executive.popen(run_xvfb, stderr=devnull)
+ self._xvfb_process = self._port.host.executive.popen(run_xvfb, stderr=devnull, env=environment)
# Crashes intend to occur occasionally in the first few tests that are run through each
# worker because the Xvfb display isn't ready yet. Halting execution a bit should avoid that.
Modified: trunk/Tools/Scripts/webkitpy/port/xvfbdriver_unittest.py (172829 => 172830)
--- trunk/Tools/Scripts/webkitpy/port/xvfbdriver_unittest.py 2014-08-21 12:29:37 UTC (rev 172829)
+++ trunk/Tools/Scripts/webkitpy/port/xvfbdriver_unittest.py 2014-08-21 15:47:21 UTC (rev 172830)
@@ -52,6 +52,7 @@
driver = XvfbDriver(port, worker_number=worker_number, pixel_tests=True)
driver._startup_delay_secs = 0
driver._xvfb_screen_depth = lambda: '24'
+ driver._environment = port.setup_environ_for_server(port.driver_name())
return driver
def cleanup_driver(self, driver):
@@ -67,19 +68,19 @@
def test_start_no_pixel_tests(self):
driver = self.make_driver()
- expected_logs = "MOCK run_command: ['ps', '-eo', 'comm,command'], cwd=None\nMOCK popen: ['Xvfb', ':0', '-screen', '0', '1024x768x24', '-nolisten', 'tcp']\n"
+ expected_logs = ("MOCK run_command: ['ps', '-eo', 'comm,command'], cwd=None\nMOCK popen: ['Xvfb', ':0', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'], env=%s\n" % driver._environment)
self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=":0")
self.cleanup_driver(driver)
def test_start_pixel_tests(self):
driver = self.make_driver()
- expected_logs = "MOCK run_command: ['ps', '-eo', 'comm,command'], cwd=None\nMOCK popen: ['Xvfb', ':0', '-screen', '0', '1024x768x24', '-nolisten', 'tcp']\n"
+ expected_logs = ("MOCK run_command: ['ps', '-eo', 'comm,command'], cwd=None\nMOCK popen: ['Xvfb', ':0', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'], env=%s\n" % driver._environment)
self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=":0", pixel_tests=True)
self.cleanup_driver(driver)
def test_start_arbitrary_worker_number(self):
driver = self.make_driver(worker_number=17)
- expected_logs = "MOCK run_command: ['ps', '-eo', 'comm,command'], cwd=None\nMOCK popen: ['Xvfb', ':0', '-screen', '0', '1024x768x24', '-nolisten', 'tcp']\n"
+ expected_logs = ("MOCK run_command: ['ps', '-eo', 'comm,command'], cwd=None\nMOCK popen: ['Xvfb', ':0', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'], env=%s\n" % driver._environment)
self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=":0", pixel_tests=True)
self.cleanup_driver(driver)
@@ -108,12 +109,12 @@
def test_start_next_worker(self):
driver = self.make_driver()
driver._next_free_display = lambda: 0
- expected_logs = "MOCK popen: ['Xvfb', ':0', '-screen', '0', '1024x768x24', '-nolisten', 'tcp']\n"
+ expected_logs = ("MOCK popen: ['Xvfb', ':0', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'], env=%s\n" % driver._environment)
self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=":0", pixel_tests=True)
self.cleanup_driver(driver)
driver = self.make_driver()
driver._next_free_display = lambda: 3
- expected_logs = "MOCK popen: ['Xvfb', ':3', '-screen', '0', '1024x768x24', '-nolisten', 'tcp']\n"
+ expected_logs = ("MOCK popen: ['Xvfb', ':3', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'], env=%s\n" % driver._environment)
self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=":3", pixel_tests=True)
self.cleanup_driver(driver)
Modified: trunk/Tools/gtk/jhbuild.modules (172829 => 172830)
--- trunk/Tools/gtk/jhbuild.modules 2014-08-21 12:29:37 UTC (rev 172829)
+++ trunk/Tools/gtk/jhbuild.modules 2014-08-21 15:47:21 UTC (rev 172830)
@@ -335,8 +335,10 @@
</autotools>
<autotools id="mesa" autogenargs="--enable-xlib-glx --disable-dri --with-gallium-drivers=swrast" skip-install="true">
+ <!--- WARNING: At jhbuildrc, when we define the path to the Gallium llvmpipe software rasterizer (needed by XvfbDriver),
+ we assume that the directory is named "Mesa". So, don't change the checkoutdir name even if you update the version. -->
<branch module="/pub/mesa/10.2.1/MesaLib-10.2.1.tar.bz2" version="10.2.1"
- checkoutdir="Mesa-10.2.1"
+ checkoutdir="Mesa"
repo="ftp.freedesktop.org"
hash="sha256:461277909207da689d8152cfbf9e182ea6f70e1e672ab64c67df83725c8d2b54"/>
</autotools>
Modified: trunk/Tools/gtk/jhbuildrc (172829 => 172830)
--- trunk/Tools/gtk/jhbuildrc 2014-08-21 12:29:37 UTC (rev 172829)
+++ trunk/Tools/gtk/jhbuildrc 2014-08-21 15:47:21 UTC (rev 172830)
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-# Copyright (C) 2011 Igalia S.L.
+# Copyright (C) 2011-2014 Igalia S.L.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -16,6 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
import sys
+import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../jhbuild") )
import jhbuildrc_common
@@ -33,6 +34,6 @@
autogenargs='--enable-introspection'
if use_lib64:
- os.environ['LLVMPIPE_LIBGL_PATH'] = os.path.abspath(os.path.join(checkoutroot, 'Mesa-10.2.1', 'lib64'))
+ os.environ['LLVMPIPE_LIBGL_PATH'] = os.path.abspath(os.path.join(checkoutroot, 'Mesa', 'lib64', 'gallium'))
else:
- os.environ['LLVMPIPE_LIBGL_PATH'] = os.path.abspath(os.path.join(checkoutroot, 'Mesa-10.2.1', 'lib'))
+ os.environ['LLVMPIPE_LIBGL_PATH'] = os.path.abspath(os.path.join(checkoutroot, 'Mesa', 'lib', 'gallium'))