Re: [PATCH] tests/init.sh: new file to be used via most *.sh tests

2009-11-27 Thread Ralf Wildenhues
* Jim Meyering wrote on Fri, Nov 27, 2009 at 10:03:10PM CET: > > so just a couple of notes: Automake has a similar file tests/defs.in > > that is not as elaborate; still, you might be able to profit from it. > > For example, turning on VERBOSE if srcdir is not set but derived from > > $0 is very ha

Re: [PATCH] tests/init.sh: new file to be used via most *.sh tests

2009-11-27 Thread Jim Meyering
Ralf Wildenhues wrote: > * Jim Meyering wrote on Wed, Nov 25, 2009 at 02:49:59PM CET: >> I've pushed tests/init.sh, as yet unused. > > I haven't looked at this in detail, due to time constraints, Hi Ralf, Thanks for the feedback. FYI, the mkdtemp-related code has been in gnulib for some time, Eve

Re: [PATCH] tests/init.sh: new file to be used via most *.sh tests

2009-11-27 Thread Ralf Wildenhues
Hi Jim, * Jim Meyering wrote on Wed, Nov 25, 2009 at 02:49:59PM CET: > I've pushed tests/init.sh, as yet unused. I haven't looked at this in detail, due to time constraints, so just a couple of notes: Automake has a similar file tests/defs.in that is not as elaborate; still, you might be able to

Re: [PATCH] tests/init.sh: new file to be used via most *.sh tests

2009-11-26 Thread Jim Meyering
Bruno Haible wrote: > Jim Meyering wrote: >> srcdir is expected to come from automake, and there, it is guaranteed >> to be sanitized. It is usually simply "." or ".." or the name of a >> package's subdirectory like "src" or "lib". > > But it can contain absolute directory names. For example, whe

Re: [PATCH] tests/init.sh: new file to be used via most *.sh tests

2009-11-26 Thread Jim Meyering
Bruno Haible wrote: > Jim Meyering wrote: >> --- a/tests/init.sh >> +++ b/tests/init.sh >> @@ -27,6 +27,7 @@ >> # Note that these commands are executed in a subdirectory, therefore you >> # need to prepend "../" to relative filenames in the build directory. >> # Set the exit code 0 for suc

Re: [PATCH] tests/init.sh: new file to be used via most *.sh tests

2009-11-26 Thread Bruno Haible
Jim Meyering wrote: > --- a/tests/init.sh > +++ b/tests/init.sh > @@ -27,6 +27,7 @@ > # Note that these commands are executed in a subdirectory, therefore you > # need to prepend "../" to relative filenames in the build directory. > # Set the exit code 0 for success, 77 for skipped, or 1 o

Re: [PATCH] tests/init.sh: new file to be used via most *.sh tests

2009-11-26 Thread Bruno Haible
Jim Meyering wrote: > srcdir is expected to come from automake, and there, it is guaranteed > to be sanitized. It is usually simply "." or ".." or the name of a > package's subdirectory like "src" or "lib". But it can contain absolute directory names. For example, when I have a package in /home/b

Re: [PATCH] tests/init.sh: new file to be used via most *.sh tests

2009-11-26 Thread Jim Meyering
Eric Blake wrote: > According to Bruno Haible on 11/25/2009 3:24 PM: >> + # Note that these commands are executed in a subdirectory, therefore you >> + # need to prepend "../" to relative filenames in the build dir. >> + # Set the exit code 0 for success, 77 for skipped, or 1 or other for >>

Re: [PATCH] tests/init.sh: new file to be used via most *.sh tests

2009-11-26 Thread Jim Meyering
Bruno Haible wrote: >> I want to use something like this for each of the tests I own ... >> ... >> I'll post some examples of using this new framework later today. > > One of the most important aspects of unit tests is that users are able to > 1. execute a single test, rather than all tests, >

Re: [PATCH] tests/init.sh: new file to be used via most *.sh tests

2009-11-26 Thread Jim Meyering
Bruno Haible wrote: > Hi Jim, > >> +test -f $srcdir/init.cfg \ >> + && . $srcdir/init.cfg > > Directory names containing spaces are not so uncommon, especially on Cygwin. > How about writing "$srcdir/init.cfg" ? > > Likewise in test-pread.sh. srcdir is expected to come from automake, and there,

Re: [PATCH] tests/init.sh: new file to be used via most *.sh tests

2009-11-25 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Bruno Haible on 11/25/2009 3:24 PM: > + # Note that these commands are executed in a subdirectory, therefore you > + # need to prepend "../" to relative filenames in the build dir. > + # Set the exit code 0 for success, 77 for skippe

Re: [PATCH] tests/init.sh: new file to be used via most *.sh tests

2009-11-25 Thread Bruno Haible
Hi Jim, > I want to use something like this for each of the tests I own ... > ... > I'll post some examples of using this new framework later today. One of the most important aspects of unit tests is that users are able to 1. execute a single test, rather than all tests, 2. single step throug

Re: [PATCH] tests/init.sh: new file to be used via most *.sh tests

2009-11-25 Thread Bruno Haible
Hi Jim, > +test -f $srcdir/init.cfg \ > + && . $srcdir/init.cfg Directory names containing spaces are not so uncommon, especially on Cygwin. How about writing "$srcdir/init.cfg" ? Likewise in test-pread.sh. Bruno

[PATCH] tests/init.sh: new file to be used via most *.sh tests

2009-11-25 Thread Jim Meyering
sing this new framework later today. >From ef77cd53d352251ed2bc7995ac6951f29f091bad Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 25 Nov 2009 14:40:31 +0100 Subject: [PATCH] tests/init.sh: new file to be used via most *.sh tests * tests/init.sh: New file. --- ChangeL