[PATCH 2 of 3] run-tests: handle windows crlf in .py tests again
Adrian Buehlmann
adrian at cadifra.com
Thu Oct 18 12:36:07 CDT 2012
On 2012-10-18 01:51, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <mads at kiilerich.com>
> # Date 1350513209 -7200
> # Node ID 35f134b39cdbfff327c8daaf8011c6c9b3e98482
> # Parent 209a0c3ab878b7dcc5c8af563a8ca13f9c1e3474
> run-tests: handle windows crlf in .py tests again
>
> Before af7c6bc48d8d all crlf occurrences in test output on Windows were simply
> changed to lf. In af7c6bc48d8d it was replaced by more clever handling in the
> .t test runner ... but the .py runner was forgotten and many .py tests were
> failing on Windows.
>
> The crlf/lf replacement is now reintroduced in the py test runner.
>
> diff --git a/tests/run-tests.py b/tests/run-tests.py
> --- a/tests/run-tests.py
> +++ b/tests/run-tests.py
> @@ -476,6 +476,8 @@
> py3kswitch = options.py3k_warnings and ' -3' or ''
> cmd = '%s%s "%s"' % (PYTHON, py3kswitch, test)
> vlog("# Running", cmd)
> + if os.name == 'nt':
> + replacements.append((r'\r\n', '\n'))
> return run(cmd, wd, options, replacements)
>
> def shtest(test, wd, options, replacements):
I confirm these two patches work on Windows as advertised.
*.py tests now pass again with this one.
More information about the Mercurial-devel
mailing list