Title: [128117] trunk/Tools
- Revision
- 128117
- Author
- [email protected]
- Date
- 2012-09-10 15:22:01 -0700 (Mon, 10 Sep 2012)
Log Message
TestExpectationsChecker._determine_port_from_expectations_path() does not support cascaded TestExpectations
https://bugs.webkit.org/show_bug.cgi?id=96205
Patch by Christophe Dumez <[email protected]> on 2012-09-10
Reviewed by Tony Chang.
_determine_port_from_expectations_path() was calling port.path_to_test_expectations_file()
internally, which means that it would support only 1 TestExpectations file per port. This
is an issue for ports such as EFL that support cascased TestExpectations (efl-wk2 -> efl
and efl-wk1 -> efl).
This patch makes _determine_port_from_expectations_path() call port.expectations_files()
instead so that all the ports TestExpectations are recognized. The ports are also
constructed twice, with "webkit_test_runner" option set to True and False so that we
retrieve the TestExpectations paths for both WebKit1 and WebKit2.
* Scripts/webkitpy/style/checkers/test_expectations.py:
(TestExpectationsChecker._determine_port_from_expectations_path):
* Scripts/webkitpy/style/checkers/test_expectations_unittest.py: Add corresponding unit test.
(TestExpectationsTestCase.test_determine_port_from_expectations_path):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (128116 => 128117)
--- trunk/Tools/ChangeLog 2012-09-10 22:21:49 UTC (rev 128116)
+++ trunk/Tools/ChangeLog 2012-09-10 22:22:01 UTC (rev 128117)
@@ -1,3 +1,25 @@
+2012-09-10 Christophe Dumez <[email protected]>
+
+ TestExpectationsChecker._determine_port_from_expectations_path() does not support cascaded TestExpectations
+ https://bugs.webkit.org/show_bug.cgi?id=96205
+
+ Reviewed by Tony Chang.
+
+ _determine_port_from_expectations_path() was calling port.path_to_test_expectations_file()
+ internally, which means that it would support only 1 TestExpectations file per port. This
+ is an issue for ports such as EFL that support cascased TestExpectations (efl-wk2 -> efl
+ and efl-wk1 -> efl).
+
+ This patch makes _determine_port_from_expectations_path() call port.expectations_files()
+ instead so that all the ports TestExpectations are recognized. The ports are also
+ constructed twice, with "webkit_test_runner" option set to True and False so that we
+ retrieve the TestExpectations paths for both WebKit1 and WebKit2.
+
+ * Scripts/webkitpy/style/checkers/test_expectations.py:
+ (TestExpectationsChecker._determine_port_from_expectations_path):
+ * Scripts/webkitpy/style/checkers/test_expectations_unittest.py: Add corresponding unit test.
+ (TestExpectationsTestCase.test_determine_port_from_expectations_path):
+
2012-09-10 Ryuan Choi <[email protected]>
[WTR] Generated source files should include config.h
Modified: trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations.py (128116 => 128117)
--- trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations.py 2012-09-10 22:21:49 UTC (rev 128116)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations.py 2012-09-10 22:22:01 UTC (rev 128117)
@@ -49,11 +49,14 @@
def _determine_port_from_expectations_path(self, host, expectations_path):
# Pass a configuration to avoid calling default_configuration() when initializing the port (takes 0.5 seconds on a Mac Pro!).
- options = optparse.Values({'configuration': 'Release'})
+ options_wk1 = optparse.Values({'configuration': 'Release', 'webkit_test_runner': False})
+ options_wk2 = optparse.Values({'configuration': 'Release', 'webkit_test_runner': True})
for port_name in host.port_factory.all_port_names():
- port = host.port_factory.get(port_name, options=options)
- if port.path_to_test_expectations_file().replace(port.path_from_webkit_base() + host.filesystem.sep, '') == expectations_path:
- return port
+ ports = [host.port_factory.get(port_name, options=options_wk1), host.port_factory.get(port_name, options=options_wk2)]
+ for port in ports:
+ for test_expectation_file in port.expectations_files():
+ if test_expectation_file.replace(port.path_from_webkit_base() + host.filesystem.sep, '') == expectations_path:
+ return port
return None
def __init__(self, file_path, handle_style_error, host=None):
Modified: trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py (128116 => 128117)
--- trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py 2012-09-10 22:21:49 UTC (rev 128116)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py 2012-09-10 22:22:01 UTC (rev 128117)
@@ -79,6 +79,9 @@
self._expect_port_for_expectations_path('chromium', 'LayoutTests/platform/chromium/TestExpectations')
self._expect_port_for_expectations_path(None, '/mock-checkout/LayoutTests/platform/win/TestExpectations')
self._expect_port_for_expectations_path('win', 'LayoutTests/platform/win/TestExpectations')
+ self._expect_port_for_expectations_path('efl', 'LayoutTests/platform/efl/TestExpectations')
+ self._expect_port_for_expectations_path('efl', 'LayoutTests/platform/efl-wk1/TestExpectations')
+ self._expect_port_for_expectations_path('efl', 'LayoutTests/platform/efl-wk2/TestExpectations')
def assert_lines_lint(self, lines, should_pass, expected_output=None):
self._error_collector.reset_errors()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes