Commit Graph

5 Commits

Author SHA1 Message Date
Siddharth Agarwal
d1d7def3b9 tests: fix file modes 2014-10-29 19:34:36 -07:00
David M. Carr
33f1efdddf tests: extract git command-line client and dulwich requirements into testutil
One or both of these requirements were in almost every test in exactly the same
way.  Now, these checks are performed in every test that uses the testutil.
This makes it easier for test authors to add these checks into new tests (just
add a reference to the testutil, which you'd probably want anyway).

We considered having each test declare their requirements (currently, either
"git" or "dulwich"), but in this case, preferred the simplicity of having the
check always performed (even if a particular test doesn't need one or the
other).  You can't perform any meaningful testing of Hg-Git without both of
these dependencies properly configured.  The main value to checking for them
in the tests (rather than just letting the tests fail) is that it gives a
meaningful error message to help people figure out how to fix their environment.
In the case that either git or dulwich is missing, the information will be
just as clearly conveyed regardless of whether its all the tests that are
skipped, or just most of them.

I didn't add dulwich to hghave (even though this is clearly the sort of thing
that hghave is intended for) because hghave is currently pulled from Mercurial
completely unchanged, and it's probably best to keep it that way.

Tested by running the tests in three configurations:
 * No dulwich installed (ran 0, skipped 28, failed 0, output:
        Skipped *: missing feature: dulwich)
 * Bad git on path (ran 1, skipped 27, failed 0, output:
        Skipped *: missing feature: git command line client)
 * Working git and correct version of dulwich installed
        (ran 28, skipped 0, failed 0)

Thanks to Felipe Contreras for the idea to extract this logic into a library.
2012-11-03 19:11:50 -04:00
David M. Carr
8d69bf5e9a tests: extract extension configuration into a testutil library
Thanks to Felipe Contreras for the patch which this was based on.

Even though the MQ extension was only used in a single test
(test-pull-after-strip.t), I included it in the testutil.  It shouldn't hurt
anything to have it enabled and not used, and saves us from having to deal
with enabling extensions in individual tests at all.

Similarly, this changeset results in the graphlog extension being enabled
for all tests, even though there were some that didn't use it before.  This is
even less significant in Mercurial 2.3+, since in those versions, graphlog is
part of core, and is available even when the extension is disabled.
2012-10-30 20:03:26 -04:00
David M. Carr
91ca9b4626 tests: remove configuration of bookmarks extension
All of our supported Hg versions include bookmarks in core.  Thus, actovating
it in the hgrc and setting bookmarks.track.current are no longer needed.
2012-09-13 20:48:11 -04:00
David M. Carr
0bbf714c18 tests: unify test-push-r 2012-09-10 00:27:56 -04:00