[PATCH] run-tests: fix b68a41420397 for Windows

Adrian Buehlmann adrian at cadifra.com
Mon May 9 08:35:10 CDT 2011


On 2011-05-09 15:26, Martin Geisler wrote:
> Adrian Buehlmann <adrian at cadifra.com> writes:
> 
>> # HG changeset patch
>> # User Adrian Buehlmann <adrian at cadifra.com>
>> # Date 1304945704 -7200
>> # Node ID e1d2a92f0e66d979143d27f272b753a7686c3729
>> # Parent  abaf5a2982c36fe7e6992ebce6354a103375181f
>> run-tests: fix b68a41420397 for Windows
>>
>> Before b68a41420397 it was at least possible to run things like
>>
>>   $ python run-tests.py test-check-code-hg.py
>>   WARNING: Did not find prerequisite tool: gunzip.exe
>>   .
>>   # Ran 1 tests, 0 skipped, 0 failed.
>>
>> on Windows. Since b68a41420397 I now get:
>>
>>   $ python run-tests.py test-check-code-hg.py
>>   Usage: run-tests.py [options] [tests]
>>
>>   run-tests.py: error: --shell must be executable
>>
>> This patch fixes it for me by bypassing the new check that was
>> inserted with b68a41420397.
>>
>> diff --git a/tests/run-tests.py b/tests/run-tests.py
>> --- a/tests/run-tests.py
>> +++ b/tests/run-tests.py
>> @@ -181,7 +181,7 @@
>>          options.pure = True
>>  
>>      if not (os.path.isfile(options.shell) and
>> -            os.access(options.shell, os.X_OK)):
>> +            os.access(options.shell, os.X_OK) or os.name == 'nt'):
>>          parser.error('--shell must be executable')
> 
> Could we instead provid a better default value for the shell on Windows?
> 
> Before, "/bin/sh" was hard-coded and so I expect that nothing worked
> anyway after the startup checks?

It did work on Windows before your change, as I wrote in my change
message. Did you read it?

I have cygwin installed on Windows 7 here.

$ python -c "import os; print os.path.isfile('/bin/sh')"
False

But

$ /bin/sh
sh-4.1$


More information about the Mercurial-devel mailing list