bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: init.sh features


From: Eric Blake
Subject: Re: init.sh features
Date: Mon, 05 Apr 2010 15:37:55 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc12 Lightning/1.0b1 Thunderbird/3.0.4

On 04/05/2010 03:08 PM, Bruno Haible wrote:
> Jim Meyering wrote:
>> This could be an argument for wrapping some of the C-only tests in a
>> simple init.sh-using driver (maybe even automatically).  Any test that
>> creates a temporary file would benefit.
> 
> Yes, I agree: It would make things simpler and more robust if all tests
> that require temporary files would have a shell script as test driver.
> Among others, this would guarantee that temporary files get erased when
> the test gets interrupted with Ctrl-C. In theory, this can be done with
> a signal handler, but most tests are written in a minimal way and don't
> care about this. (Only tests/test-stat-time.c and tests/test-posix_spawn3.c
> install a signal handler for cleanup.)

Many of my recent *at tests use a common idiom of removing such
temporary files if they happen to exist as garbage from a previous run,
but I agree that changing things over to a shell wrapper would relieve
the burden on the C code needing to be robust against Ctrl-C.  On the
other hand, when debugging a test that hangs due to a platform bug, it
would be nice to keep the temporary files around.  So if we do switch to
shell wrappers, it would be wise to make the cleanup traps use things
like ${RM=rm} rather than plain rm, to allow the use of RM=: as a way to
override the cleanup.

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]