Windows Tests

Patrick Mézard pmezard at gmail.com
Mon May 16 15:10:19 CDT 2011


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


More information about the Mercurial-devel mailing list