[PATCH] run-test: replace backslashes in TESTDIR

Adrian Buehlmann adrian at cadifra.com
Sat Jun 9 13:50:16 CDT 2012


On 2012-06-09 18:53, Adrian Buehlmann wrote:
> On 2012-06-09 17:17, Mads Kiilerich wrote:
>> Mads Kiilerich wrote, On 06/04/2012 03:20 AM:
>>> Adrian Buehlmann wrote, On 06/03/2012 07:40 PM:
>>>> # HG changeset patch
>>>> # User Adrian Buehlmann<adrian at cadifra.com>
>>>> # Date 1338744923 -7200
>>>> # Node ID 81f15de595760f3592e34b8d97c5f9ef2e760a80
>>>> # Parent  7b460b49bf7b75c5a4ab444915c52802c9f97f33
>>>> run-test: replace backslashes in TESTDIR
>>>>
>>>> This may cause troubles in MSYS on Windows.
>>>
>>> pushed to crew default, thanks.
>>
>> - as http://selenic.com/repo/hg/rev/ac3e063eebf1 .
>>
>> It looked good and innocent, but it happens to cause troubles in MSYS on 
>> Windows.
> 
> Well. I am using MSYS on Windows.
> 
>> For example test-ssh.t will fail because msys see a "something 
>> c:/something" path and assume it is a posix path list and translate it 
>> to the windows style which is "something C;c:/MinGW/.../something". 
>> (http://www.mingw.org/wiki/Posix_path_conversion )
> 
> The ssh tests always failed here. Before any of my patches and after.
> 
>> What trouble did it fix? AFAICS it would be better to back it out.
> 
> Please not.
> 
> The motivation was
> http://selenic.com/pipermail/mercurial-devel/2012-June/040850.html
> 
> without that, your #if implementation doesn't work at all in MSYS.
> 
>> We could probably apply some workarounds like using "\"python\" 
>> \"$TESTDIR..." to avoid msys being too clever, but I would prefer not to 
>> do so if we don't have to.
>>
>> /Mads
> 
> This needs more investigation. I haven't tried making the ssh tests
> work. They never worked here so far.

I've pulled 5af80d29c441 from crew and updated to that.

Then

  $ python run-tests.py --local test-run-tests.t
  .
  # Ran 1 tests, 0 skipped, 0 failed.

passes (as expected).

If I then apply this patch (to backout ac3e063eebf1):

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1229,7 +1229,7 @@
             del os.environ[k]
 
     global TESTDIR, HGTMP, INST, BINDIR, PYTHONDIR, COVERAGE_FILE
-    TESTDIR = os.environ["TESTDIR"] = os.getcwd().replace('\\', '/')
+    TESTDIR = os.environ["TESTDIR"] = os.getcwd()
     if options.tmpdir:
         options.keep_tmpdir = True
         tmpdir = options.tmpdir

test-run-tests.t fails like this:

  $ python run-tests.py --local test-run-tests.t

  --- C:\Users\adi\hgrepos\hg-main\tests\test-run-tests.t
  +++ C:\Users\adi\hgrepos\hg-main\tests\test-run-tests.t.err
  @@ -70,6 +70,7 @@
     tested
   #else
     $ echo skipped
  +  skipped
   #endif

   #if false

  ERROR: C:\Users\adi\hgrepos\hg-main\tests\test-run-tests.t output changed
  !
  Failed test-run-tests.t: output changed
  # Ran 1 tests, 0 skipped, 1 failed.


So, ac3e063eebf1 is still needed for #if to work correctly.

I'll investigate if that "replace('\\', '/')" can be moved.





More information about the Mercurial-devel mailing list