[PATCH 1 of 2] run-tests: make --tmpdir option more useful

Martin Geisler mg at lazybytes.net
Thu Jul 23 11:55:20 CDT 2009


Matt Mackall <mpm at selenic.com> writes:

> On Thu, 2009-07-23 at 14:18 +0200, Martin Geisler wrote:
>> Martin Geisler <mg at lazybytes.net> writes:
>> 
>> > Augie Fackler <durin42 at gmail.com> writes:
>> >
>> >> On Jul 12, 2009, at 4:52 PM, Greg Ward wrote:
>> >>
>> >>> On Sun, Jul 12, 2009 at 12:10 PM, Augie Fackler<durin42 at gmail.com>
>> >>> wrote:
>> >>>>
>> >>>> On Jul 11, 2009, at 5:54 PM, Greg Ward wrote:
>> >>>>> # HG changeset patch
>> >>>>> # User Greg Ward <greg at gerg.ca>
>> >>>>> # Date 1247350616 14400
>> >>>>> # Node ID ad3cd96f3eab09436624b230cb9f0830a70e155b
>> >>>>> # Parent  54eb3782d32fcc9de072b5e7c9efb6b2bad211c3
>> >>>>> run-tests: make --tmpdir option more useful.
>> >>>>>
>> >>>>> - instead of creating HGTMP inside tmpdir, now HGTMP is tmpdir
>> >>>>>  (thus, fail if tmpdir already exists)
>> >>>>> - passing --tmpdir automatically turns on --keep-tmpdir
>> >>>>
>> >>>> I'm going to chime in with a -1 on that - I frequently assign the
>> >>>> tmpdir to be on a RAM disk for speed, and still want the test
>> >>>> results to be blown away. In fact, I've never used --keep-tmpdir.
>> >
>> > Would it not be easier for you to set TMP=/mnt/ramdisk instead of
>> > --tmpdir=/mn/ramdisk? Using the former should have the same effect as
>> > the latter, except that it will delete the tmpdir after Greg's patch.
>> 
>> Do you still think this patch is bad? After Greg's patch things should
>> work like this (I didn't actually test it, I just read the code):
>> 
>> * no options: create temporary files in /tmp or as specified by TMP.
>>   Delete them automatically.
>> 
>> * --tmpdir DIR: create temporary files in DIR. Do not delete them
>>   automatically.
>
> Seems to me we should just have a --keep flag.

After thinking about it on my way home, I think it's the --keep-tmpdir
flag that is unneeded. Without it, we would then have exactly two modes:

* run-test.py picks a random directory and cleans up automatically.

* you pick the directory and you get to clean it up.

It seems like a nice feature to be able to specify a fixed directory for
the test -- using TMP will merely specify the parent directory for the
randomly generated test directory.

Greg, what do you think -- you proposed the original patches :-)

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial-devel/attachments/20090723/fd445753/attachment.pgp 


More information about the Mercurial-devel mailing list