Title: [116692] trunk/Tools
Revision
116692
Author
rak...@webkit.org
Date
2012-05-10 15:00:02 -0700 (Thu, 10 May 2012)

Log Message

[webkitpy][EFL] It should be possible to use a wrapper command for ImageDiff.
https://bugs.webkit.org/show_bug.cgi?id=86145

Reviewed by Dirk Pranke.

The GTK+ and EFL ports use jhbuild to build a few base libraries
which are then used when building the port itself. Programs such
as DRT and ImageDiff are then supposed to be run with the
`run-with-jhbuild' wrapper so that the libraries are properly
found and loaded.

This was already the case for DumpRenderTree (EflPort defines the
'wrapper' option for that), but it was not possible to do the same
with ImageDiff so far.

The code which created the ImageDiff command-line call has been
moved to a separate method, _image_diff_command, which is then
overridden by EflPort to add the jhbuild wrapper.

* Scripts/webkitpy/layout_tests/port/efl.py:
(EflPort.__init__):
(EflPort._image_diff_command):
* Scripts/webkitpy/layout_tests/port/webkit.py:
(WebKitPort):
(WebKitPort._image_diff_command):
(WebKitPort._start_image_diff_process):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (116691 => 116692)


--- trunk/Tools/ChangeLog	2012-05-10 21:53:35 UTC (rev 116691)
+++ trunk/Tools/ChangeLog	2012-05-10 22:00:02 UTC (rev 116692)
@@ -1,3 +1,32 @@
+2012-05-10  Raphael Kubo da Costa  <rak...@webkit.org>
+
+        [webkitpy][EFL] It should be possible to use a wrapper command for ImageDiff.
+        https://bugs.webkit.org/show_bug.cgi?id=86145
+
+        Reviewed by Dirk Pranke.
+
+        The GTK+ and EFL ports use jhbuild to build a few base libraries
+        which are then used when building the port itself. Programs such
+        as DRT and ImageDiff are then supposed to be run with the
+        `run-with-jhbuild' wrapper so that the libraries are properly
+        found and loaded.
+
+        This was already the case for DumpRenderTree (EflPort defines the
+        'wrapper' option for that), but it was not possible to do the same
+        with ImageDiff so far.
+
+        The code which created the ImageDiff command-line call has been
+        moved to a separate method, _image_diff_command, which is then
+        overridden by EflPort to add the jhbuild wrapper.
+
+        * Scripts/webkitpy/layout_tests/port/efl.py:
+        (EflPort.__init__):
+        (EflPort._image_diff_command):
+        * Scripts/webkitpy/layout_tests/port/webkit.py:
+        (WebKitPort):
+        (WebKitPort._image_diff_command):
+        (WebKitPort._start_image_diff_process):
+
 2012-05-10  Zan Dobersek  <zandober...@gmail.com>
 
         [GTK] ENABLE_IFRAME_SEAMLESS support

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/efl.py (116691 => 116692)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/efl.py	2012-05-10 21:53:35 UTC (rev 116691)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/efl.py	2012-05-10 22:00:02 UTC (rev 116692)
@@ -42,8 +42,10 @@
     def __init__(self, *args, **kwargs):
         WebKitPort.__init__(self, *args, **kwargs)
 
-        self.set_option_default('wrapper', self.path_from_webkit_base('Tools', 'efl', 'run-with-jhbuild'))
+        self._jhbuild_wrapper_path = self.path_from_webkit_base('Tools', 'efl', 'run-with-jhbuild')
 
+        self.set_option_default('wrapper', self._jhbuild_wrapper_path)
+
     def _port_flag_for_scripts(self):
         return "--efl"
 
@@ -62,6 +64,9 @@
     def _path_to_image_diff(self):
         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)
+
     def _path_to_webcore_library(self):
         static_path = self._build_path('WebCore', 'libwebcore_efl.a')
         dyn_path = self._build_path('WebCore', 'libwebcore_efl.so')

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py (116691 => 116692)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py	2012-05-10 21:53:35 UTC (rev 116691)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py	2012-05-10 22:00:02 UTC (rev 116692)
@@ -170,7 +170,7 @@
         process = self._start_image_diff_process(expected_contents, actual_contents, tolerance=tolerance)
         return self._read_image_diff(process)
 
-    def _start_image_diff_process(self, expected_contents, actual_contents, tolerance=None):
+    def _image_diff_command(self, tolerance=None):
         # FIXME: There needs to be a more sane way of handling default
         # values for options so that you can distinguish between a default
         # value of None and a default value that wasn't set.
@@ -179,7 +179,12 @@
                 tolerance = self.get_option('tolerance')
             else:
                 tolerance = 0.1
+
         command = [self._path_to_image_diff(), '--tolerance', str(tolerance)]
+        return command
+
+    def _start_image_diff_process(self, expected_contents, actual_contents, tolerance=None):
+        command = self._image_diff_command(tolerance)
         environment = self.setup_environ_for_server('ImageDiff')
         process = server_process.ServerProcess(self, 'ImageDiff', command, environment)
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to