Changeset 74362 in webkit


Ignore:
Timestamp:
Dec 20, 2010 1:45:54 PM (13 years ago)
Author:
jamesr@google.com
Message:

2010-12-20 Cosmin Truta <ctruta@chromium.org>

Reviewed by James Robinson.

new-run-webkit-tests ignores trailing EOL differences in text tests
https://bugs.webkit.org/show_bug.cgi?id=36983

Changed the handling of new-line characters within new-run-webkit-tests
to match old-run-webkit-tests. Differences in leading and trailing empty
lines in text expectation files are no longer ignored.

  • Scripts/webkitpy/layout_tests/port/base.py:
  • Scripts/webkitpy/layout_tests/port/test.py: Added unit tests. Removed old duplicate unit test entries.
  • Scripts/webkitpy/layout_tests/test_types/text_diff.py:
Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r74356 r74362  
     12010-12-20  Cosmin Truta  <ctruta@chromium.org>
     2
     3        Reviewed by James Robinson.
     4
     5        new-run-webkit-tests ignores trailing EOL differences in text tests
     6        https://bugs.webkit.org/show_bug.cgi?id=36983
     7
     8        Changed the handling of new-line characters within new-run-webkit-tests
     9        to match old-run-webkit-tests.  Differences in leading and trailing empty
     10        lines in text expectation files are no longer ignored.
     11
     12        * Scripts/webkitpy/layout_tests/port/base.py:
     13        * Scripts/webkitpy/layout_tests/port/test.py:
     14        Added unit tests.  Removed old duplicate unit test entries.
     15        * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
     16
    1172010-12-20  David Levin  <levin@chromium.org>
    218
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py

    r74163 r74362  
    323323
    324324    def expected_text(self, test):
    325         """Returns the text output we expect the test to produce."""
     325        """Returns the text output we expect the test to produce.
     326        End-of-line characters are normalized to '\n'."""
    326327        # FIXME: DRT output is actually utf-8, but since we don't decode the
    327328        # output from DRT (instead treating it as a binary string), we read the
     
    331332            return ''
    332333        text = self._filesystem.read_binary_file(path)
    333         return text.strip("\r\n").replace("\r\n", "\n") + "\n"
     334        return text.replace("\r\n", "\n")
    334335
    335336    def filename_to_uri(self, filename):
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/test.py

    r74301 r74362  
    9191        base.Port.__init__(self, **kwargs)
    9292        tests = TestList(self)
    93         tests.add('passes/image.html')
    94         tests.add('passes/text.html')
    9593        tests.add('failures/expected/checksum.html',
    9694                  actual_checksum='checksum_fail-checksum')
     
    115113        tests.add('failures/expected/missing_text.html',
    116114                  expected_text=None)
     115        tests.add('failures/expected/newlines_leading.html',
     116                  expected_text="\nfoo\n",
     117                  actual_text="foo\n")
     118        tests.add('failures/expected/newlines_trailing.html',
     119                  expected_text="foo\n\n",
     120                  actual_text="foo\n")
     121        tests.add('failures/expected/newlines_with_excess_CR.html',
     122                  expected_text="foo\r\r\r\n",
     123                  actual_text="foo\n")
    117124        tests.add('failures/expected/text.html',
    118125                  actual_text='text_fail-png')
     
    127134        tests.add('passes/image.html')
    128135        tests.add('passes/platform_image.html')
    129         tests.add('passes/text.html')
     136        # Text output files contain "\r\n" on Windows.  This may be
     137        # helpfully filtered to "\r\r\n" by our Python/Cygwin tooling.
     138        tests.add('passes/text.html',
     139                  expected_text='\nfoo\n\n',
     140                  actual_text='\nfoo\r\n\r\r\n')
    130141        tests.add('websocket/tests/passes/text.html')
    131142        self._tests = tests
     
    273284WONTFIX : failures/expected/missing_image.html = MISSING PASS
    274285WONTFIX : failures/expected/missing_text.html = MISSING PASS
     286WONTFIX : failures/expected/newlines_leading.html = TEXT
     287WONTFIX : failures/expected/newlines_trailing.html = TEXT
     288WONTFIX : failures/expected/newlines_with_excess_CR.html = TEXT
    275289WONTFIX : failures/expected/text.html = TEXT
    276290WONTFIX : failures/expected/timeout.html = TIMEOUT
  • trunk/Tools/Scripts/webkitpy/layout_tests/test_types/text_diff.py

    r74163 r74362  
    5050
    5151    def _get_normalized_output_text(self, output):
    52         # Some tests produce "\r\n" explicitly.  Our system (Python/Cygwin)
    53         # helpfully changes the "\n" to "\r\n", resulting in "\r\r\n".
    54         norm = output.replace("\r\r\n", "\r\n").strip("\r\n").replace(
    55              "\r\n", "\n")
    56         return norm + "\n"
     52        """Returns the normalized text output, i.e. the output in which
     53        the end-of-line characters are normalized to "\n"."""
     54        # Running tests on Windows produces "\r\n".  The "\n" part is helpfully
     55        # changed to "\r\n" by our system (Python/Cygwin), resulting in
     56        # "\r\r\n", when, in fact, we wanted to compare the text output with
     57        # the normalized text expectation files.
     58        return output.replace("\r\r\n", "\r\n").replace("\r\n", "\n")
    5759
    5860    def compare_output(self, port, filename, test_args, actual_test_output,
Note: See TracChangeset for help on using the changeset viewer.