Skip to content

Instantly share code, notes, and snippets.

@balazs
Created Jul 20, 2012
Embed
What would you like to do?
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/base.py b/Tools/Scripts/webkitpy/layout_tests/port/base.py
index a1bd5bf..4b6384e 100755
--- a/Tools/Scripts/webkitpy/layout_tests/port/base.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/base.py
@@ -1263,6 +1263,12 @@ class Port(object):
def _supports_switching_pixel_tests_per_test(self):
return False
+ def defines_pixel_test_directories(self):
+ return False
+
+ def pixel_test_directories(self):
+ raise NotImplementedError("Port.pixel_test_directories")
+
class VirtualTestSuite(object):
def __init__(self, name, base, args, tests=None):
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/qt.py b/Tools/Scripts/webkitpy/layout_tests/port/qt.py
index dad36b4..6229365 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/qt.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/qt.py
@@ -188,3 +188,9 @@ class QtPort(WebKitPort):
def _supports_switching_pixel_tests_per_test(self):
return True
+
+ def defines_pixel_test_directories(self):
+ return True
+
+ def pixel_test_directories(self):
+ return ['compositing']
diff --git a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
index 35a8657..4de7d2a 100755
--- a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
+++ b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
@@ -30,6 +30,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import errno
+import glob
import logging
import optparse
import os
@@ -189,16 +190,22 @@ def _set_up_derived_options(port, options):
warnings.append("--pixel-test-directories has no effect without --pixel-tests")
options.pixel_test_directories = []
else:
- sanitized = []
- for directory in options.pixel_test_directories:
- relative_path = port.relative_test_path_from_layout_tests_dir(directory)
- if not os.path.isdir(os.path.join(port.layout_tests_dir(), relative_path)):
- warnings.append("--pixel-test-directories expects list of directories but got: " + directory)
- else:
- sanitized.append(relative_path)
-
- options.pixel_test_directories = list(set(sanitized))
-
+ if 'all' in options.pixel_test_directories:
+ options.pixel_test_directories = [directory for directory in glob.glob(port.layout_test_dir(), '*')
+ if os.path.isdir(directory)]
+ else:
+ sanitized = []
+ for directory in options.pixel_test_directories:
+ relative_path = port.relative_test_path_from_layout_tests_dir(directory)
+ if not os.path.isdir(os.path.join(port.layout_tests_dir(), relative_path)):
+ warnings.append("--pixel-test-directories expects list of directories but got: " + directory)
+ else:
+ sanitized.append(relative_path)
+
+ options.pixel_test_directories = list(set(sanitized))
+
+ elif port.defines_pixel_test_directories():
+ options.pixel_test_directories = por.pixel_test_directories()
return warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment