Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/factory.py (133506 => 133507)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/factory.py 2012-11-05 19:21:39 UTC (rev 133506)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/factory.py 2012-11-05 19:24:39 UTC (rev 133507)
@@ -29,26 +29,32 @@
"""Factory method to retrieve the appropriate port implementation."""
+import fnmatch
import optparse
import re
from webkitpy.layout_tests.port import builders
-def platform_options(**help_strings):
+def platform_options(use_globs=False):
return [
optparse.make_option('--platform', action='',
- help=help_strings.get('platform', 'Platform/Port being tested (e.g., "mac-lion")')),
- optparse.make_option('--chromium', action='', const='chromium', dest='platform',
- help='Alias for --platform=chromium'),
- optparse.make_option('--chromium-android', action='', const='chromium-android', dest='platform',
- help='Alias for --platform=chromium-android'),
- optparse.make_option('--efl', action='', const='efl', dest="platform",
- help='Alias for --platform=efl'),
- optparse.make_option('--gtk', action='', const='gtk', dest="platform",
- help='Alias for --platform=gtk'),
- optparse.make_option('--qt', action='', const='qt', dest="platform",
- help='Alias for --platform=qt'),
+ help=('Glob-style list of platform/ports to use (e.g., "mac*")' if use_globs else 'Platform to use (e.g., "mac-lion")')),
+ optparse.make_option('--chromium', action='', dest='platform',
+ const=('chromium*' if use_globs else 'chromium'),
+ help=('Alias for --platform=chromium*' if use_globs else 'Alias for --platform=chromium')),
+ optparse.make_option('--chromium-android', action='', dest='platform',
+ const=('chromium-android*' if use_globs else 'chromium-android'),
+ help=('Alias for --platform=chromium-android*' if use_globs else 'Alias for --platform=chromium')),
+ optparse.make_option('--efl', action='', dest='platform',
+ const=('efl*' if use_globs else 'efl'),
+ help=('Alias for --platform=efl*' if use_globs else 'Alias for --platform=efl')),
+ optparse.make_option('--gtk', action='', dest='platform',
+ const=('gtk*' if use_globs else 'gtk'),
+ help=('Alias for --platform=gtk*' if use_globs else 'Alias for --platform=gtk')),
+ optparse.make_option('--qt', action='', dest="platform",
+ const=('qt*' if use_globs else 'qt'),
+ help=('Alias for --platform=qt' if use_globs else 'Alias for --platform=qt')),
]
@@ -122,18 +128,18 @@
return cls(self._host, port_name, options=options, **kwargs)
raise NotImplementedError('unsupported platform: "%s"' % port_name)
- def all_port_names(self):
+ def all_port_names(self, platform=None):
"""Return a list of all valid, fully-specified, "real" port names.
This is the list of directories that are used as actual baseline_paths()
by real ports. This does not include any "fake" names like "test"
- or "mock-mac", and it does not include any directories that are not ."""
- # FIXME: There's probably a better way to generate this list ...
- return builders.all_port_names()
+ or "mock-mac", and it does not include any directories that are not.
+ If platform is not specified, we will glob-match all ports"""
+ platform = platform or '*'
+ return fnmatch.filter(builders.all_port_names(), platform)
+
def get_from_builder_name(self, builder_name):
port_name = builders.port_name_for_builder_name(builder_name)
- assert(port_name) # Need to update port_name_for_builder_name
- port = self.get(port_name, _builder_options(builder_name))
- assert(port) # Need to update port_name_for_builder_name
- return port
+ assert port_name, "unrecognized builder name '%s'" % builder_name
+ return self.get(port_name, _builder_options(builder_name))
Modified: trunk/Tools/Scripts/webkitpy/tool/commands/queries.py (133506 => 133507)
--- trunk/Tools/Scripts/webkitpy/tool/commands/queries.py 2012-11-05 19:21:39 UTC (rev 133506)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/queries.py 2012-11-05 19:24:39 UTC (rev 133507)
@@ -440,7 +440,7 @@
help='Print a CSV-style report that includes the port name, modifiers, tests, and expectations'),
make_option('-f', '--full', action='', default=False,
help='Print a full TestExpectations-style line for every match'),
- ] + platform_options(platform='port/platform to use. Use glob-style wildcards for multiple ports (implies --csv)') + configuration_options()
+ ] + platform_options(use_globs=True)
AbstractDeclarativeCommand.__init__(self, options=options)
self._expectation_models = {}
@@ -519,7 +519,7 @@
help='Print a CSV-style report that includes the port name, test_name, test platform, baseline type, baseline location, and baseline platform'),
make_option('--include-virtual-tests', action='',
help='Include virtual tests'),
- ] + platform_options(platform='port/platform to use. Use glob-style wildcards for multiple ports (implies --csv)') + configuration_options()
+ ] + platform_options(use_globs=True)
AbstractDeclarativeCommand.__init__(self, options=options)
self._platform_regexp = re.compile('platform/([^\/]+)/(.+)')
Modified: trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline.py (133506 => 133507)
--- trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline.py 2012-11-05 19:21:39 UTC (rev 133506)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline.py 2012-11-05 19:24:39 UTC (rev 133507)
@@ -67,7 +67,7 @@
help=('Do not optimize/de-dup the expectations after rebaselining (default is to de-dup automatically). '
'You can use "webkit-patch optimize-baselines" to optimize separately.'))
- platform_options = factory.platform_options()
+ platform_options = factory.platform_options(use_globs=True)
results_directory_option = optparse.make_option("--results-directory", help="Local results directory to use")
@@ -353,7 +353,7 @@
help_text = "Rebaseline based off JSON passed to stdin. Intended to only be called from other scripts."
def __init__(self,):
- return super(RebaselineJson, self).__init__(options=[
+ super(RebaselineJson, self).__init__(options=[
self.move_overwritten_baselines_option,
self.no_optimize_option,
self.results_directory_option,
Modified: trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py (133506 => 133507)
--- trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py 2012-11-05 19:21:39 UTC (rev 133506)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py 2012-11-05 19:24:39 UTC (rev 133507)
@@ -312,7 +312,8 @@
def setUp(self):
super(TestRebaselineExpectations, self).setUp()
- self.options = MockOptions(optimize=True, builders=None, suffixes=['txt'], verbose=False)
+ self.options = MockOptions(optimize=False, builders=None, suffixes=['txt'], verbose=False, platform=None,
+ move_overwritten_baselines=False, results_directory=None)
def test_rebaseline_expectations(self):
self._zero_out_test_expectations()
@@ -320,7 +321,7 @@
self.tool.executive = MockExecutive2()
self.command._tests_to_rebaseline = lambda port: {'userscripts/another-test.html': set(['txt']), 'userscripts/images.svg': set(['png'])}
- self.command.execute(MockOptions(optimize=False, verbose=False, move_overwritten_baselines=False, results_directory=None), [], self.tool)
+ self.command.execute(self.options, [], self.tool)
# FIXME: change this to use the test- ports.
calls = filter(lambda x: x != ['qmake', '-v'], self.tool.executive.calls)