Windows Tests

Friedrich, Anna-Christina Anna-Christina.Friedrich at draeger.com
Mon May 23 08:28:57 CDT 2011


 

> -----Original Message-----
> From: Patrick Mézard [mailto:pmezard at gmail.com] 
> Sent: Montag, 16. Mai 2011 22:10
> To: Friedrich, Anna-Christina
> Cc: mercurial-devel at selenic.com
> Subject: Re: Windows Tests
> 
> Le 20/04/11 15:53, Friedrich, Anna-Christina a écrit :
> > Hello,
> >  
> > referring to previous mails, I'd like to propose a change 
> for Mercurial Testsuite running on Windows.
> > I converted 135 unified tests to batch scripts, which can 
> be run with run-tests.py.
> > I know you are providing a windows testing plan. But as we 
> are working in a professional environment and thinking of 
> switching to Mercurial, we need to test Mercurial in its 
> usual environment that is cmd.exe.
> >  
> > I can provide those batch tests and a python module, which 
> converts unified tests to batch scripts. This module is not 
> perfect. There are few commands you have to adjust manually 
> after converting. Some unified tests can't even be converted, 
> because of Linux commands like 'chmod' or 'ln'.
> > Nonetheless there are 135 out of approximately 370 tests 
> running on Windows, if you make three changes to the Testsuite:
> >  
> > Two changes to run-tests.py:
> >  
> > diff -r 788e88d90033 tests/run-tests.py
> > --- a/tests/run-tests.py        Wed Feb 09 13:28:29 2011 +0100
> > +++ b/tests/run-tests.py        Wed Apr 20 15:43:30 2011 +0200
> > @@ -342,8 +342,9 @@
> >          os.symlink(sys.executable, mypython)
> >      except AttributeError:
> >          # windows fallback
> > -        shutil.copyfile(sys.executable, mypython)
> > -        shutil.copymode(sys.executable, mypython)
> > +        mypythonexefile = mypython + '.exe'
> > +        shutil.copyfile(sys.executable, mypythonexefile)
> > +        shutil.copymode(sys.executable, mypythonexefile)
> >  
> >  def installhg(options):
> >      vlog("# Performing temporary installation of HG") @@ -596,6 
> > +597,8 @@
> >          ret = fromchild.close()
> >          if ret is None:
> >              ret = 0
> > +        for s, r in replacements:
> > +            output = re.sub(s, r, output,flags=re.IGNORECASE)
> >      else:
> >          proc = Popen4(cmd)
> >          def cleanup():
> >  
> >  
> > And one change to hg.bat file (has already been mentioned 
> in previous mail):
> >  
> > diff -r 788e88d90033 contrib/win32/hg.bat
> > --- a/contrib/win32/hg.bat      Wed Feb 09 13:28:29 2011 +0100
> > +++ b/contrib/win32/hg.bat      Wed Apr 20 15:43:30 2011 +0200
> > @@ -8,5 +8,5 @@
> >  rem install does not put python.exe on the PATH...
> >  rem %~dp0 is the directory of this script
> >  
> > -"%~dp0..\python" "%~dp0hg" %*
> > +"%~dp0\python" "%~dp0hg" %*
> >  endlocal
> >  
> >  
> > As you see, we cannot use the Testing Plan, because of the 
> required environment for testing.
> > Are you interested in integrating those batch files and 
> therefore adjust the mentioned files?
> 
> I pushed modified versions of your fixes, starting here:
> 
>   http://hg.intevation.org/mercurial/crew/rev/220f31030e7f
> 
> Thanks!
> --
> Patrick Mézard
> 

Thank you very much for this first step. It'll help us a lot.
What about the other proposals:
1. Turning replacement into case-insensitive-replacement

diff -r ec0a6fe1d001 tests/run-tests.py
--- a/tests/run-tests.py        Wed May 04 15:16:52 2011 +0200
+++ b/tests/run-tests.py        Mon May 23 15:21:09 2011 +0200
@@ -705,7 +705,7 @@
         signal.alarm(options.timeout)

     ret, out = runner(testpath, options, [
-        (re.escape(testtmp), '$TESTTMP'),
+        ('(?i)' + re.escape(testtmp), '$TESTTMP'),
         (r':%s\b' % options.port, ':$HGPORT'),
         (r':%s\b' % (options.port + 1), ':$HGPORT1'),
         (r':%s\b' % (options.port + 2), ':$HGPORT2'),


2. As well as adjusting pythonpath in hg.bat

diff -r 788e88d90033 contrib/win32/hg.bat
--- a/contrib/win32/hg.bat      Wed Feb 09 13:28:29 2011 +0100
+++ b/contrib/win32/hg.bat      Wed Apr 20 15:43:30 2011 +0200
@@ -8,5 +8,5 @@
 rem install does not put python.exe on the PATH...
 rem %~dp0 is the directory of this script
  
 -"%~dp0..\python" "%~dp0hg" %*
 +"%~dp0\python" "%~dp0hg" %*
  endlocal

Unfortunately I don't know if changing hg.bat affects anything else inside the code.

Best regards
Anna Friedrich
---
This communication contains confidential information. If you are not the intended recipient please return this email to the sender and delete it from your records.

Diese Nachricht enthält vertrauliche Informationen. Sollten Sie nicht der beabsichtigte Empfänger dieser E-mail sein, senden Sie bitte diese an den Absender zurück und löschen Sie die E-mail aus Ihrem System.



More information about the Mercurial-devel mailing list