Commit 2fb61180 authored by skobes's avatar skobes Committed by Commit bot

Add flag-specific baseline search path to run-webkit-tests.

BUG=598180

Review-Url: https://codereview.chromium.org/2182813002
Cr-Commit-Position: refs/heads/master@{#407685}
parent ddc3a45d
...@@ -300,7 +300,10 @@ class Port(object): ...@@ -300,7 +300,10 @@ class Port(object):
return [self._filesystem.join(path, suite.name) for path in self.default_baseline_search_path()] return [self._filesystem.join(path, suite.name) for path in self.default_baseline_search_path()]
def baseline_search_path(self): def baseline_search_path(self):
return self.get_option('additional_platform_directory', []) + self._compare_baseline() + self.default_baseline_search_path() return (self.get_option('additional_platform_directory', []) +
self._flag_specific_baseline_search_path() +
self._compare_baseline() +
self.default_baseline_search_path())
def default_baseline_search_path(self): def default_baseline_search_path(self):
"""Return a list of absolute paths to directories to search under for """Return a list of absolute paths to directories to search under for
...@@ -1265,6 +1268,11 @@ class Port(object): ...@@ -1265,6 +1268,11 @@ class Port(object):
return [self._filesystem.join(self.layout_tests_dir(), 'FlagExpectations', flag.lstrip('-')) return [self._filesystem.join(self.layout_tests_dir(), 'FlagExpectations', flag.lstrip('-'))
for flag in self.get_option('additional_driver_flag', [])] for flag in self.get_option('additional_driver_flag', [])]
def _flag_specific_baseline_search_path(self):
# TODO(skobes): Baselines specific to both flag and platform?
return [self._filesystem.join(self.layout_tests_dir(), 'flag-specific', flag.lstrip('-'))
for flag in self.get_option('additional_driver_flag', [])]
def expectations_dict(self): def expectations_dict(self):
"""Returns an OrderedDict of name -> expectations strings. """Returns an OrderedDict of name -> expectations strings.
The names are expected to be (but not required to be) paths in the filesystem. The names are expected to be (but not required to be) paths in the filesystem.
......
...@@ -211,6 +211,11 @@ class PortTest(unittest.TestCase): ...@@ -211,6 +211,11 @@ class PortTest(unittest.TestCase):
[('/tmp/local-baselines', 'fast/test-expected.txt')]) [('/tmp/local-baselines', 'fast/test-expected.txt')])
self.assertEqual(port.baseline_path(), '/foo') self.assertEqual(port.baseline_path(), '/foo')
# Flag-specific baseline directory
port._options.additional_platform_directory = []
port._options.additional_driver_flag = ['--special-flag']
self.assertEqual(port.baseline_path(), '/mock-checkout/third_party/WebKit/LayoutTests/flag-specific/special-flag')
def test_nonexistant_expectations(self): def test_nonexistant_expectations(self):
port = self.make_port(port_name='foo') port = self.make_port(port_name='foo')
port.expectations_files = lambda: ['/mock-checkout/third_party/WebKit/LayoutTests/platform/exists/TestExpectations', port.expectations_files = lambda: ['/mock-checkout/third_party/WebKit/LayoutTests/platform/exists/TestExpectations',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment