Changeset 120349 in webkit


Ignore:
Timestamp:
Jun 14, 2012 12:43:05 PM (12 years ago)
Author:
dpranke@chromium.org
Message:

new-run-webkit-tests doesn't find similar platform tests for a keyword
https://bugs.webkit.org/show_bug.cgi?id=37956

Reviewed by Ryosuke Niwa.

This patches adds support for NRWT so that if you type
"new-run-webkit-tests foo" it will run all the tests in foo as
well as platform/foo for all of the platforms that are normally
searched (this only applies to directories, not to individual tests).

  • Scripts/webkitpy/layout_tests/controllers/manager.py:

(Manager.collect_tests):

  • Scripts/webkitpy/layout_tests/port/base.py:

(Port.tests):
(Port):
(Port._expanded_paths):

  • Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:

(MainTest.test_no_http_tests):
(MainTest):
(MainTest.test_platform_tests_are_found):

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r120348 r120349  
     12012-06-14  Dirk Pranke  <dpranke@chromium.org>
     2
     3        new-run-webkit-tests doesn't find similar platform tests for a keyword
     4        https://bugs.webkit.org/show_bug.cgi?id=37956
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        This patches adds support for NRWT so that if you type
     9        "new-run-webkit-tests foo" it will run all the tests in foo as
     10        well as platform/foo for all of the platforms that are normally
     11        searched (this only applies to directories, not to individual tests).
     12
     13        * Scripts/webkitpy/layout_tests/controllers/manager.py:
     14        (Manager.collect_tests):
     15        * Scripts/webkitpy/layout_tests/port/base.py:
     16        (Port.tests):
     17        (Port):
     18        (Port._expanded_paths):
     19        * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
     20        (MainTest.test_no_http_tests):
     21        (MainTest):
     22        (MainTest.test_platform_tests_are_found):
     23
    1242012-06-14  Dirk Pranke  <dpranke@chromium.org>
    225
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py

    r120249 r120349  
    497497
    498498    def tests(self, paths):
    499         """Return the list of tests found."""
    500         return self._real_tests(paths).union(self._virtual_tests(paths, self.populated_virtual_test_suites()))
     499        """Return the list of tests found. Both generic and platform-specific tests matching paths should be returned."""
     500        expanded_paths = self._expanded_paths(paths)
     501        return self._real_tests(expanded_paths).union(self._virtual_tests(expanded_paths, self.populated_virtual_test_suites()))
     502
     503    def _expanded_paths(self, paths):
     504        expanded_paths = []
     505        fs = self._filesystem
     506        all_platform_dirs = [path for path in fs.glob(fs.join(self.layout_tests_dir(), 'platform', '*')) if fs.isdir(path)]
     507        for path in paths:
     508            expanded_paths.append(path)
     509            if self.test_isdir(path) and not path.startswith('platform'):
     510                for platform_dir in all_platform_dirs:
     511                    if fs.isdir(fs.join(platform_dir, path)):
     512                        expanded_paths.append(self.relative_test_filename(fs.join(platform_dir, path)))
     513
     514        return expanded_paths
    501515
    502516    def _real_tests(self, paths):
  • trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py

    r120348 r120349  
    882882        self.assertTrue(MainTest.has_test_of_type(batch_tests_run_http, 'websocket'))
    883883
     884    def test_platform_tests_are_found(self):
     885        tests_run = get_tests_run(['http'], tests_included=True, flatten_batches=True)
     886        self.assertTrue('platform/test-snow-leopard/http/test.html' in tests_run)
     887
    884888
    885889class EndToEndTest(unittest.TestCase):
Note: See TracChangeset for help on using the changeset viewer.