unexpected output behaviour using test-suite on windows
Patrick Mézard
pmezard at gmail.com
Wed Mar 23 08:38:40 CDT 2011
Le 23/03/11 09:14, Friedrich, Anna-Christina a écrit :
> Hello,
>
> I am running batch tests on winXP via run-tests.py using the current stable version from the developer repository(developing with eclipse).
> I had to adjust two parts of the code, so that it is possible to run hg commands in a batch file at all.
>
> diff -r 643b8212813e contrib/win32/hg.bat
> --- a/contrib/win32/hg.bat Wed Feb 16 15:02:30 2011 +0100
> +++ b/contrib/win32/hg.bat Tue Mar 22 14:18:12 2011 +0100
> @@ -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
>
> diff -r 643b8212813e tests/run-tests.py
> --- a/tests/run-tests.py Wed Feb 16 15:02:30 2011 +0100
> +++ b/tests/run-tests.py Tue Mar 22 14:18:12 2011 +0100
> @@ -344,8 +344,9 @@
> os.symlink(sys.executable, mypython)
> except AttributeError:
> # windows fallback
> - shutil.copyfile(sys.executable, mypython)
> - shutil.copymode(sys.executable, mypython)
> + mypythonexe = mypython + '.exe'
> + shutil.copyfile(sys.executable, mypythonexe)
> + shutil.copymode(sys.executable, mypythonexe)
>
> def installhg(options):
> vlog("# Performing temporary installation of HG")
>
>
> Everything works as expected while using '-l' option, but while hg is installed in a temp file, output from console is not predictable.
> Sometimes there is output, sometimes not, sometimes just a part of the expected output.
>
> First example:
>
> @echo off
> hg init --help
> echo test
> @echo on
Try "call hg init --help" instead of "hg init --help".
FWIW, this is how I run tests on Windows:
http://mercurial.selenic.com/wiki/WindowsTestingPlan
It is not easy, it is not pleasant but it works for at least 2/3 of them. I would not try with cmd.exe, it is way too underpowered to write anything else than trivial tests.
--
Patrick Mézard
More information about the Mercurial-devel
mailing list