[PATCH 6 of 6] run-tests: use a file for capturing replacements

Gregory Szorc gregory.szorc at gmail.com
Mon Mar 30 13:49:05 CDT 2015


On Mon, Mar 30, 2015 at 11:45 AM, Augie Fackler <raf at durin42.com> wrote:

> On Sat, Mar 28, 2015 at 08:15:11PM -0700, Gregory Szorc wrote:
> > # HG changeset patch
> > # User Gregory Szorc <gregory.szorc at gmail.com>
> > # Date 1427575392 25200
> > #      Sat Mar 28 13:43:12 2015 -0700
> > # Node ID 03d1333662fb83144a7dac9de798c82902ceb30b
> > # Parent  f62a75b235644da799d0f43e492e55aca2e66206
> > run-tests: use a file for capturing replacements
> >
>
> [...] Overall, I like this, but...
>
> >  #endif
> > +
> > +Replacements written to replacements file are substituted
> > +
> > +  $ cat > test-replacement.t << EOF
> > +  >   $ cat >> \$REPLACEMENTS << EOF
> > +  >   > re
> > +  >   > REPLACE_ME
> > +  >   > REPLACED
> > +  >   > EOF
> > +  >   $ echo REPLACE_ME
> > +  >   REPLACED
> > +  > EOF
> > +
> > +  $ $TESTDIR/run-tests.py --with-hg=`which hg` test-replacement.t
> > +  .
> > +  # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
>
> I'm not in love with the way tests can define replacements and then
> they're:
>
> 1) permanent and
> 2) global to all tests
>
> 2 is the worrying part, really, because I can see it leading to some
> very kooky test failures that would depend on the order in which tests
> execute. Could I persuade you to have a --replacements-file= flag to
> run-tests instead?
>
>
Oh, making it global was definitely not my intent. v2 will definitely have
per-test replacements, like how DAEMON_PIDS works.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150330/34aecea8/attachment.html>


More information about the Mercurial-devel mailing list