Changeset 72564 in webkit


Ignore:
Timestamp:
Nov 22, 2010 2:52:30 PM (13 years ago)
Author:
hayato@chromium.org
Message:

2010-11-22 Hayato Ito <hayato@chromium.org>

Reviewed by Shinichiro Hamaji.

Ignore reference files which will be used by reftests when collecting
test cases.
https://bugs.webkit.org/show_bug.cgi?id=49835

  • Scripts/webkitpy/layout_tests/port/test_files.py:
  • Scripts/webkitpy/layout_tests/port/test_files_unittest.py:
Location:
trunk/WebKitTools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r72555 r72564  
     12010-11-22  Hayato Ito  <hayato@chromium.org>
     2
     3        Reviewed by Shinichiro Hamaji.
     4
     5        Ignore reference files which will be used by reftests when collecting
     6        test cases.
     7        https://bugs.webkit.org/show_bug.cgi?id=49835
     8
     9        * Scripts/webkitpy/layout_tests/port/test_files.py:
     10        * Scripts/webkitpy/layout_tests/port/test_files_unittest.py:
     11
    1122010-11-22  Adam Roben  <aroben@apple.com>
    213
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/test_files.py

    r67974 r72564  
    7979    test_files = set()
    8080    for path in paths_to_walk:
    81         if os.path.isfile(path) and _has_supported_extension(path):
     81        if os.path.isfile(path) and _is_test_file(path):
    8282            test_files.add(os.path.normpath(path))
    8383            continue
     
    9696
    9797            for filename in files:
    98                 if _has_supported_extension(filename):
     98                if _is_test_file(filename):
    9999                    filename = os.path.join(root, filename)
    100100                    filename = os.path.normpath(filename)
     
    112112    extension = os.path.splitext(filename)[1]
    113113    return extension in _supported_file_extensions
     114
     115
     116def _is_reference_html_file(filename):
     117    """Return true if the filename points to a reference HTML file."""
     118    if (filename.endswith('-expected.html') or
     119        filename.endswith('-expected-mismatch.html')):
     120        _log.warn("Reftests are not supported - ignoring %s" % filename)
     121        return True
     122    return False
     123
     124
     125def _is_test_file(filename):
     126    """Return true if the filename points to a test file."""
     127    return (_has_supported_extension(filename) and
     128            not _is_reference_html_file(filename))
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/test_files_unittest.py

    r67974 r72564  
    6464        self.assertEqual(tests, set([]))
    6565
     66    def test_is_test_file(self):
     67        self.assertTrue(test_files._is_test_file('foo.html'))
     68        self.assertTrue(test_files._is_test_file('foo.shtml'))
     69        self.assertFalse(test_files._is_test_file('foo.png'))
     70        self.assertFalse(test_files._is_test_file('foo-expected.html'))
     71        self.assertFalse(test_files._is_test_file('foo-expected-mismatch.html'))
     72
    6673
    6774if __name__ == '__main__':
Note: See TracChangeset for help on using the changeset viewer.