[PATCH V4] run-tests: use hghave.py

Matt Mackall mpm at selenic.com
Wed Jun 20 16:58:45 CDT 2012


On Wed, 2012-06-20 at 23:06 +0200, Mads Kiilerich wrote:
> Adrian Buehlmann wrote, On 06/19/2012 01:45 PM:
> > # HG changeset patch
> > # User Adrian Buehlmann <adrian at cadifra.com>
> > # Date 1340041060 -7200
> > # Node ID 60e6c72cc6df5e3c1e8abd88c6949a6382e31411
> > # Parent  79902f7e27df0eeae96d4d47d5c8a12fae2a0bb7
> > run-tests: use hghave.py
> >
> > Eliminates the start of a subprocess for #if requirements checking.
> >
> > The has_xxx functions in hghave.py now get the path where they should do their
> > check in.
> ...
> > diff --git a/tests/run-tests.py b/tests/run-tests.py
> > --- a/tests/run-tests.py
> > +++ b/tests/run-tests.py
> > @@ -54,6 +54,7 @@
> >   import time
> >   import re
> >   import threading
> > +import hghave
> 
> This will introduce an import dependency from run-tests to the mercurial 
> that we are testing. I'm waiting for Matt to decide on that.

It's kind of unfortunate. Whether it's more or less unfortunate than
duplicating code is unclear. However, the coupling is already there, as
for all practical purposes hghave is already part of run-tests. So I
don't think this really changes things, nor should it block progress in
this direction.

> > @@ -1306,6 +1301,11 @@
> >   
> >       COVERAGE_FILE = os.path.join(TESTDIR, ".coverage")
> >   
> > +    # insert root in sys.path, so mercurial can be imported in hghave
> > +    rootdir = os.path.realpath(os.path.join(TESTDIR, ".."))
> > +    if rootdir not in sys.path:
> > +        sys.path.insert(1, rootdir)
> > +
> 
> In the case where we are testing without -l (and thus will create a temp 
> hg install) and haven't run 'make local' then this will point at a 
> mercurial without any compiled binary extensions. That might not be what 
> we want and wasn't what we did before.

Slightly more worrisome.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list