[PATCH 1 of 1 STABLE] tests: adjust hghave for MSYS on Windows
Mads
mads at kiilerich.com
Tue May 22 07:12:03 CDT 2012
On 22/05/12 00:48, Adrian Buehlmann wrote:
> # HG changeset patch
> # User Adrian Buehlmann<adrian at cadifra.com>
> # Date 1337638357 -7200
> # Branch stable
> # Node ID a3fb96e0ec33740278512338a4ebd6bba05f8f4f
> # Parent 70597a7ed10f3536194cb29ff76706745963be55
> tests: adjust hghave for MSYS on Windows
>
> Tests having these are currenly well known not to work on Windows.
> If the respective tools happen to be installed, the tests crash,
> fail, or hang forever.
FWIW: I (and the buildbot) doesn't need these changes. That might be
because these tools haven't been installed.
We obviously have to keep the balance between getting as good test
coverage as possible and trying to run tests that will fail for various
other reasons. I have in the past disabled too many tests just to get
something that can run without failure, but we could consider tightening
it up now when we are getting closer to something that works in several
setups.
I assume that you as windows user and lead windows developer better can
make that trade-off than me ... but I will add some comments anyway:
> diff --git a/tests/hghave b/tests/hghave
> --- a/tests/hghave
> +++ b/tests/hghave
> @@ -126,9 +126,13 @@
> return False
>
> def has_gettext():
> + if os.name == 'nt':
> + return False # msgfmt.exe crashes on Windows
> return matchoutput('msgfmt --version', 'GNU gettext-tools')
The msgfmt from msys doesn't crash for me. Could you investigate why it
crashes for you?
test-i18n.t will however fail - apparently because the only way to
change the locale on windows is with a global setting? It would be nice
if it could be controlled with an environment setting somehow - that
would be convenient both for users and for testing.
Would it be feasible to make it work instead of accepting the failure?
> def has_git():
> + if os.name == 'nt':
> + return False # causes troubles on Windows
> return matchoutput('git --version 2>&1', r'^git version')
It is apparently only some git versions that cause trouble. It would be
nice to run the tests if we have a git version that works.
> @@ -145,16 +149,24 @@
> return (int(m.group(1)), int(m.group(2)))
>
> def has_svn15():
> + if os.name == 'nt':
> + return False # causes troubles on Windows
> return getsvnversion()>= (1, 5)
>
> def has_svn13():
> + if os.name == 'nt':
> + return False # causes troubles on Windows
> return getsvnversion()>= (1, 3)
>
> def has_svn():
> + if os.name == 'nt':
> + return False # causes troubles on Windows
> return matchoutput('svn --version 2>&1', r'^svn, version') and \
> matchoutput('svnadmin --version 2>&1', r'^svnadmin, version')
>
> def has_svn_bindings():
> + if os.name == 'nt':
> + return False # causes troubles on Windows
> try:
> import svn.core
> version = svn.core.SVN_VER_MAJOR, svn.core.SVN_VER_MINOR
> @@ -165,6 +177,8 @@
> return False
>
> def has_p4():
> + if os.name == 'nt':
> + return False # causes troubles on Windows
> return matchoutput('p4 -V', r'Rev\. P4/') and matchoutput('p4d -V', r'Rev\. P4D/')
I assume that many windows users would like to convert from svn / p4 on
windows. It would thus be very nice if we could run the tests there too.
What kind of trouble do you see - and can you fix it?
Would it help if we sanitized $PATH and tried to remove non-msys tools?
/Mads
More information about the Mercurial-devel
mailing list