[PATCH 2 of 5] tests: basic support for unified tests

Patrick Mézard pmezard at gmail.com
Wed Aug 4 11:03:51 CDT 2010


Le 04/08/10 17:20, Matt Mackall a écrit :
> On Wed, 2010-08-04 at 09:34 -0400, Greg Ward wrote:
>> Err, what about Windows?
> 
> Not addressed here. But there are various possibilities now that we're
> actually preprocessing the test. For instance:
>
> $ hg init
> U$ echo blah > a
> U: some Unix output
> W$ type blah > a
> W: some Windows output
> $ hg ci -qAm0
> 
> And we can obviously improve this by converting 'echo' to 'type' on the
> fly. This sort of thing should be enough to get a decent percentage of
> tests working.

I don't think having unix and windows versions of the same test is a good idea. cmd.exe will immediately shine with its inability to perform very simple tasks, at least without some level of wizardry nobody cares about. And it will be a maintenance/synchronization nightmare.

Having dedicated output for Windows is seducing, but again it will be hard to keep it synchronized.

Having platform specific tests fragments would help. For instance, the "delete my current directory under my feet" test just cannot execute on Windows (and AIX apparently). When this kind of test is long enough, I try to move it in its own file and use hghave to skip it. Otherwise, I execute it only if the current os.name matches a value, or echo something to match the expected output. This is ugly, perhaps the unified format may help here.

--
Patrick Mézard


More information about the Mercurial-devel mailing list