[PATCH 0 of 5] Add 'unified' tests to the test framework

Dirkjan Ochtman dirkjan at ochtman.nl
Tue Aug 3 01:56:23 CDT 2010


On Tue, Aug 3, 2010 at 07:15, Matt Mackall <mpm at selenic.com> wrote:
> This is an experiment in unifying test commands and results as
> discussed at the 1.5 sprint. See the last three patches for what tests
> look like in this model. It's quite an improvement. And when something
> breaks, you get to see the changed output in the context of the
> commands that caused it. Also, there's some basic support for
> filtering of output with regexes, like this:
>
> Strip 1: expose an old head:
>
>  $ hg --config extensions.mq= strip 5
>  saved backup bundle to .*
>
> ..which means a lot of the hoops tests jump through right now with sed
> and grep are no longer needed.

It looks very nice! Definitely something I'd use in other projects as well.

One thing that I think could be better is the need for indentation
before $ hg command. I understand that we need something to
disambiguate comments from command output, but I feel that doing it
the other way around would be better (prefix the comments, not the
output). Primarily because I think it's easier to cut-and-paste
command output that way, and we probably have more command output than
comments anyway. We could prefix comments with something like # or %.
I guess that introduces a chance of ambiguity for output starting with
# or %, but we could mitigate that by having a longer prefix, perhaps?
(e.g. %%, although I think % is sufficiently rare in our test output
and/or should be easy to prevent in most cases).

Cheers,

Dirkjan


More information about the Mercurial-devel mailing list