Changeset 76413 in webkit


Ignore:
Timestamp:
Jan 21, 2011 5:29:59 PM (13 years ago)
Author:
dpranke@chromium.org
Message:

2011-01-21 Dirk Pranke <dpranke@chromium.org>

Reviewed by Mihai Parparita.

Fix bug introduced in r76322 that caused NRWT to not actually
read the Skipped files properly.

https://bugs.webkit.org/show_bug.cgi?id=52771

  • Scripts/webkitpy/layout_tests/port/mac_unittest.py:
  • Scripts/webkitpy/layout_tests/port/webkit.py:
  • Scripts/webkitpy/layout_tests/port/webkit_unittest.py:
Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r76401 r76413  
     12011-01-21  Dirk Pranke  <dpranke@chromium.org>
     2
     3        Reviewed by Mihai Parparita.
     4
     5        Fix bug introduced in r76322 that caused NRWT to not actually
     6        read the Skipped files properly.
     7
     8        https://bugs.webkit.org/show_bug.cgi?id=52771
     9
     10        * Scripts/webkitpy/layout_tests/port/mac_unittest.py:
     11        * Scripts/webkitpy/layout_tests/port/webkit.py:
     12        * Scripts/webkitpy/layout_tests/port/webkit_unittest.py:
     13
    1142011-01-21  Sam Weinig  <sam@webkit.org>
    215
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py

    r70013 r76413  
    7070    ]
    7171
    72     def test_skipped_file_paths(self):
     72    def test_tests_from_skipped_file_contents(self):
    7373        port = self.make_port()
    7474        if not port:
    7575            return
    76         skipped_file = StringIO.StringIO(self.example_skipped_file)
    77         self.assertEqual(port._tests_from_skipped_file(skipped_file), self.example_skipped_tests)
     76        self.assertEqual(port._tests_from_skipped_file_contents(self.example_skipped_file), self.example_skipped_tests)
    7877
    7978
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py

    r76322 r76413  
    284284        return disabled_feature_tests + webarchive_tests + unsupported_feature_tests
    285285
    286     def _tests_from_skipped_file(self, skipped_file):
     286    def _tests_from_skipped_file_contents(self, skipped_file_contents):
    287287        tests_to_skip = []
    288         for line in skipped_file.readlines():
     288        for line in skipped_file_contents.split('\n'):
    289289            line = line.strip()
    290290            if line.startswith('#') or not len(line):
     
    302302                _log.warn("Failed to open Skipped file: %s" % filename)
    303303                continue
    304             skipped_file = self._filesystem.read_text_file(filename)
     304            skipped_file_contents = self._filesystem.read_text_file(filename)
     305            tests_to_skip.extend(self._tests_from_skipped_file_contents(skipped_file_contents))
    305306        return tests_to_skip
    306307
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py

    r68552 r76413  
    11#!/usr/bin/env python
    22# Copyright (C) 2010 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>, University of Szeged
     3# Copyright (C) 2010 Google Inc. All rights reserved.
    34#
    45# All rights reserved.
     
    2728import unittest
    2829
     30from webkitpy.common.system import filesystem_mock
     31
    2932from webkitpy.layout_tests.port.webkit import WebKitPort
    3033
    3134
    3235class TestWebKitPort(WebKitPort):
    33     def __init__(self, symbol_list=None, feature_list=None):
     36    def __init__(self, symbol_list=None, feature_list=None,
     37                 expectations_file=None, skips_file=None, **kwargs):
    3438        self.symbol_list = symbol_list
    3539        self.feature_list = feature_list
     40        self.expectations_file = expectations_file
     41        self.skips_file = skips_file
     42        WebKitPort.__init__(self, **kwargs)
    3643
    3744    def _runtime_feature_list(self):
     
    4754        return ["accessibility", ]
    4855
     56    def path_to_test_expectations_file(self):
     57        if self.expectations_file:
     58            return self.expectations_file
     59        return WebKitPort.path_to_test_expectations_file(self)
     60
    4961    def _skipped_file_paths(self):
     62        if self.skips_file:
     63            return [self.skips_file]
    5064        return []
    5165
     
    6781        self.assertEqual(TestWebKitPort(None, None).skipped_layout_tests(),
    6882                         set(["media", "accessibility"]))
     83
     84    def test_test_expectations(self):
     85        # Check that we read both the expectations file and anything in a
     86        # Skipped file, and that we include the feature and platform checks.
     87        files = {
     88            '/tmp/test_expectations.txt': 'BUG_TESTEXPECTATIONS SKIP : fast/html/article-element.html = FAIL\n',
     89            '/tmp/Skipped': 'fast/html/keygen.html',
     90        }
     91        mock_fs = filesystem_mock.MockFileSystem(files)
     92        port = TestWebKitPort(expectations_file='/tmp/test_expectations.txt',
     93                              skips_file='/tmp/Skipped', filesystem=mock_fs)
     94        self.assertEqual(port.test_expectations(),
     95        """BUG_TESTEXPECTATIONS SKIP : fast/html/article-element.html = FAIL
     96BUG_SKIPPED SKIP : fast/html/keygen.html = FAIL
     97BUG_SKIPPED SKIP : media = FAIL
     98BUG_SKIPPED SKIP : accessibility = FAIL""")
     99
     100
     101if __name__ == '__main__':
     102    unittest.main()
Note: See TracChangeset for help on using the changeset viewer.