[PATCH 1 of 3] run-tests: alternative way of handling \r on Windows
Mads Kiilerich
mads at kiilerich.com
Wed Oct 17 23:55:43 UTC 2012
Mads Kiilerich wrote, On 10/17/2012 01:26 PM:
> On 10/17/2012 01:10 PM, Adrian Buehlmann wrote:
>> On 2012-10-15 02:45, Mads Kiilerich wrote:
>>> # HG changeset patch
>>> # User Mads Kiilerich <mads at kiilerich.com>
>>> # Date 1350261192 -7200
>>> # Node ID b49d886bbc64ed0b4bd02f4df60db9175b3f5e80
>>> # Parent 9837cafc25b10c51659b65b5971622eab0bc9197
>>> run-tests: alternative way of handling \r on Windows
>>>
>>> After f71d60da58fb all \r was stripped from output on Windows, and
>>> the places
>>> where a \r explicitly was expected it was accepted that it was
>>> missing. Ugly
>>> hack.
>>>
>>> Instead we now accept that an extra \r might appear at the end of
>>> lines on
>>> Windows. That is more to the point and less ugly.
>> This seems to break a pile of tests on Windows. I got these with
>> 72c234081ae1:
>>
>> Failed test-atomictempfile.py: output changed
>> Failed test-batching.py: output changed
>> Failed test-bdiff.py: output changed
>> Failed test-commandserver.py: output changed
>> Failed test-context.py: output changed
>> Failed test-demandimport.py: output changed
>> Failed test-dispatch.py: output changed
>> Failed test-filelog.py: output changed
>> Failed test-hg-parseurl.py: output changed
>> Failed test-hgweb-auth.py: output changed
>> Failed test-hybridencode.py: output changed
>> Failed test-minirst.py: output changed
>> Failed test-parseindex2.py: output changed
>> Failed test-revlog-ancestry.py: output changed
>> Failed test-run-tests.t: output changed
>> Failed test-simplemerge.py: output changed
>> Failed test-status-inprocess.py: output changed
>> Failed test-trusted.py: output changed
>> Failed test-ui-color.py: output changed
>> Failed test-ui-config.py: output changed
>> Failed test-ui-verbosity.py: output changed
>> Failed test-wireproto.py: output changed
>> # Ran 356 tests, 97 skipped, 22 failed.
>>
>> Example (fails with af7c6bc48d8d):
>>
>> --- C:\Users\adi\hgrepos\hg-main\tests\test-run-tests.t
>> +++ C:\Users\adi\hgrepos\hg-main\tests\test-run-tests.t.err
>> @@ -24,16 +24,16 @@
>> Doctest commands:
>>
>> >>> print 'foo'
>> - foo
>> + foo\r (esc)
>> $ echo interleaved
>> interleaved
>> >>> for c in 'xyz':
>> ... print c
>> - x
>> - y
>> - z
>> + x\r (esc)
>> + y\r (esc)
>> + z\r (esc)
>> >>> print
>> -
>> + \r (esc)
>
> Strange. I'm sure it worked when I tested. IIRC it should be handled by
>
> if el == l or os.name == 'nt' and el[:-1] + '\r\n' == l:
> return True
>
> I will look at it later.
Bah. One last minute test change that I forgot to test on Windows plus
that I completely had forgotten the .py tests.
Patches has been sent. This time it works. Famous last words.
/Mads
More information about the Mercurial-devel
mailing list