Changeset 128117 in webkit


Ignore:
Timestamp:
Sep 10, 2012 3:22:01 PM (12 years ago)
Author:
commit-queue@webkit.org
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 <Christophe Dumez> 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):

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r128108 r128117  
     12012-09-10  Christophe Dumez  <christophe.dumez@intel.com>
     2
     3        TestExpectationsChecker._determine_port_from_expectations_path() does not support cascaded TestExpectations
     4        https://bugs.webkit.org/show_bug.cgi?id=96205
     5
     6        Reviewed by Tony Chang.
     7
     8        _determine_port_from_expectations_path() was calling port.path_to_test_expectations_file()
     9        internally, which means that it would support only 1 TestExpectations file per port. This
     10        is an issue for ports such as EFL that support cascased TestExpectations (efl-wk2 -> efl
     11        and efl-wk1 -> efl).
     12
     13        This patch makes _determine_port_from_expectations_path() call port.expectations_files()
     14        instead so that all the ports TestExpectations are recognized. The ports are also
     15        constructed twice, with "webkit_test_runner" option set to True and False so that we
     16        retrieve the TestExpectations paths for both WebKit1 and WebKit2.
     17
     18        * Scripts/webkitpy/style/checkers/test_expectations.py:
     19        (TestExpectationsChecker._determine_port_from_expectations_path):
     20        * Scripts/webkitpy/style/checkers/test_expectations_unittest.py: Add corresponding unit test.
     21        (TestExpectationsTestCase.test_determine_port_from_expectations_path):
     22
    1232012-09-10  Ryuan Choi  <ryuan.choi@samsung.com>
    224
  • trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations.py

    r127910 r128117  
    5050    def _determine_port_from_expectations_path(self, host, expectations_path):
    5151        # Pass a configuration to avoid calling default_configuration() when initializing the port (takes 0.5 seconds on a Mac Pro!).
    52         options = optparse.Values({'configuration': 'Release'})
     52        options_wk1 = optparse.Values({'configuration': 'Release', 'webkit_test_runner': False})
     53        options_wk2 = optparse.Values({'configuration': 'Release', 'webkit_test_runner': True})
    5354        for port_name in host.port_factory.all_port_names():
    54             port = host.port_factory.get(port_name, options=options)
    55             if port.path_to_test_expectations_file().replace(port.path_from_webkit_base() + host.filesystem.sep, '') == expectations_path:
    56                 return port
     55            ports = [host.port_factory.get(port_name, options=options_wk1), host.port_factory.get(port_name, options=options_wk2)]
     56            for port in ports:
     57                for test_expectation_file in port.expectations_files():
     58                    if test_expectation_file.replace(port.path_from_webkit_base() + host.filesystem.sep, '') == expectations_path:
     59                        return port
    5760        return None
    5861
  • trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py

    r127910 r128117  
    8080        self._expect_port_for_expectations_path(None, '/mock-checkout/LayoutTests/platform/win/TestExpectations')
    8181        self._expect_port_for_expectations_path('win', 'LayoutTests/platform/win/TestExpectations')
     82        self._expect_port_for_expectations_path('efl', 'LayoutTests/platform/efl/TestExpectations')
     83        self._expect_port_for_expectations_path('efl', 'LayoutTests/platform/efl-wk1/TestExpectations')
     84        self._expect_port_for_expectations_path('efl', 'LayoutTests/platform/efl-wk2/TestExpectations')
    8285
    8386    def assert_lines_lint(self, lines, should_pass, expected_output=None):
Note: See TracChangeset for help on using the changeset viewer.