avoiding forks in shell scripts (was: [PATCH] Modernize, improve and/or extend tests `colon*.test.)

2010-08-08 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, Aug 08, 2010 at 07:09:46PM CEST: > At Sunday 08 August 2010, Ralf Wildenhues wrote: > > * Stefano Lattarini wrote on Sun, Aug 08, 2010 at 06:22:00PM CEST: > > > Exactly! So: > > > foo() { foo_result=`sed ...`; } > > > foo; bar=$foo_result; > > > > > > instead

Re: avoiding forks in shell scripts (was: [PATCH] Modernize, improve and/or extend tests `colon*.test.)

2010-08-08 Thread Stefano Lattarini
At Sunday 08 August 2010, Ralf Wildenhues wrote: > * Stefano Lattarini wrote on Sun, Aug 08, 2010 at 07:09:46PM CEST: > > At Sunday 08 August 2010, Ralf Wildenhues wrote: > > > * Stefano Lattarini wrote on Sun, Aug 08, 2010 at 06:22:00PM CEST: > > > > Exactly! So: > > > > foo() { foo_result=`sed

Re: [PATCH] Modernize, improve and/or extend tests `colon*.test.

2010-08-08 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, Aug 08, 2010 at 06:22:00PM CEST: > Exactly! So: > foo() { foo_result=`sed ...`; } > foo; bar=$foo_result; > instead of: > foo() { sed ...; } > bar=`foo` > Where is the significant improvement? Two forks vs. one: the latter still forks right before exec'ing

Re: [PATCH] Modernize, improve and/or extend tests `colon*.test.

2010-08-08 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, Aug 08, 2010 at 05:35:57PM CEST: > I'm just saying that when we'll write the `extract_makefile_deps' > function, it shouldn't bother with preserving tabs and backslashes; Well, it should deal with them correctly, yes. > on the other hand, it should actively norm

Re: [PATCH] Modernize, improve and/or extend tests `colon*.test.

2010-08-08 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, Aug 08, 2010 at 05:48:58PM CEST: > At Sunday 08 August 2010, Ralf Wildenhues wrote: > > * Stefano Lattarini wrote on Sun, Aug 08, 2010 at 05:35:57PM CEST: > > > foo=`extract_makefile_deps tgt2 Makefile`; echo x"$foo"x > > More or less, yes. I'd avoid the comman

Re: [PATCH] Modernize, improve and/or extend tests `colon*.test.

2010-08-08 Thread Stefano Lattarini
At Sunday 08 August 2010, Ralf Wildenhues wrote: > * Stefano Lattarini wrote on Sun, Aug 08, 2010 at 06:06:04PM CEST: > > At Sunday 08 August 2010, Ralf Wildenhues wrote: > > > No. You save a fork with > > > > > > foo () > > > { > > > > > > ... > > > foo_result=bar > > > > > >

Re: [PATCH] Modernize, improve and/or extend tests `colon*.test.

2010-08-08 Thread Stefano Lattarini
At Sunday 08 August 2010, Ralf Wildenhues wrote: > * Stefano Lattarini wrote on Thu, Aug 05, 2010 at 01:54:20PM CEST: > > Ping on this? It seems to me that most issues with this patch > > had already been solved, so it's probably a pity to let it > > bitrotting here... > > Well, I'd prefer the ex

Re: [PATCH] Modernize, improve and/or extend tests `colon*.test.

2010-08-08 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, Aug 08, 2010 at 04:38:08PM CEST: > At Sunday 08 August 2010, Ralf Wildenhues wrote: > > * Stefano Lattarini wrote on Thu, Aug 05, 2010 at 01:54:20PM CEST: > > > Ping on this? It seems to me that most issues with this patch > > > had already been solved, so it's pr

Re: [PATCH] Modernize, improve and/or extend tests `colon*.test.

2010-08-08 Thread Stefano Lattarini
At Sunday 08 August 2010, Ralf Wildenhues wrote: > > > Well, I'd prefer the extract_dependencies script approach > > > > I like the idea, too, but as I said I'd prefer to leave for a > > later patch. > > That's fine of course. Just leave the corresponding code unchanged > then. I'll revert it, a

Re: [PATCH] Modernize, improve and/or extend tests `colon*.test.

2010-08-08 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, Aug 08, 2010 at 05:09:03PM CEST: > At Sunday 08 August 2010, Ralf Wildenhues wrote: > > tgt1 tgt2 \ > > tgt3 : dep1 dep2 \ > > dep3 \ > > dep4 > > > > Posix is perfectly clear about the list of targets > Should be "tgt1 tgt2 tgt3 tgt4", r

Re: [PATCH] Modernize, improve and/or extend tests `colon*.test.

2010-08-08 Thread Stefano Lattarini
At Sunday 08 August 2010, Ralf Wildenhues wrote: > * Stefano Lattarini wrote on Sun, Aug 08, 2010 at 05:09:03PM CEST: > > At Sunday 08 August 2010, Ralf Wildenhues wrote: > > > tgt1 tgt2 \ > > > > > > tgt3 : dep1 dep2 \ > > > dep3 \ > > > > > > dep4 > > > > > > P

Re: [PATCH] Modernize, improve and/or extend tests `colon*.test.

2010-08-08 Thread Stefano Lattarini
At Sunday 08 August 2010, Ralf Wildenhues wrote: > > > > foo=`extract_makefile_deps tgt2 Makefile`; echo x"$foo"x > > > > > > More or less, yes. I'd avoid the command substitution fork by > > > letting extract_makefile_deps set some variable instead of > > > printing. > > > > So the we'd have

Re: [PATCH] Modernize, improve and/or extend tests `colon*.test.

2010-08-08 Thread Stefano Lattarini
At Sunday 08 August 2010, Ralf Wildenhues wrote: > * Stefano Lattarini wrote on Sun, Aug 08, 2010 at 05:35:57PM CEST: > > I'm just saying that when we'll write the `extract_makefile_deps' > > function, it shouldn't bother with preserving tabs and > > backslashes; > > Well, it should deal with them

Re: [PATCH] Modernize, improve and/or extend tests `colon*.test.

2010-08-08 Thread Stefano Lattarini
At Sunday 08 August 2010, Ralf Wildenhues wrote: > * Stefano Lattarini wrote on Sun, Aug 08, 2010 at 06:22:00PM CEST: > > Exactly! So: > > foo() { foo_result=`sed ...`; } > > foo; bar=$foo_result; > > > > instead of: > > foo() { sed ...; } > > bar=`foo` > > > > Where is the significant im

Re: [PATCH] Modernize, improve and/or extend tests `colon*.test.

2010-08-08 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Thu, Aug 05, 2010 at 01:54:20PM CEST: > Ping on this? It seems to me that most issues with this patch had > already been solved, so it's probably a pity to let it bitrotting > here... Well, I'd prefer the extract_dependencies script approach which would be more corre

Re: [PATCH] Modernize, improve and/or extend tests `colon*.test.

2010-08-08 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, Aug 08, 2010 at 06:06:04PM CEST: > At Sunday 08 August 2010, Ralf Wildenhues wrote: > > No. You save a fork with > > > > foo () > > { > > ... > > foo_result=bar > > } > > > > foo ARG... > > test "$foo_result" = ... > > > Yes, but how do you get

Re: [PATCH] Modernize, improve and/or extend tests `colon*.test.

2010-08-05 Thread Stefano Lattarini
Hello Ralf. Ping on this? It seems to me that most issues with this patch had already been solved, so it's probably a pity to let it bitrotting here... Regards, Stefano

Re: unit-testing Automake (was: [PATCH] Modernize, improve and/or extend tests `colon*.test.)

2010-07-22 Thread Stefano Lattarini
At Thursday 22 July 2010, Ralf Wildenhues wrote: > * Stefano Lattarini wrote on Thu, Jul 22, 2010 at 01:04:03AM CEST: > > At Wednesday 21 July 2010, Ralf Wildenhues wrote: > > > Well, this is a common dilemma in testing: should the tester be > > > allowed to use insider information or not? [...] >

unit-testing Automake (was: [PATCH] Modernize, improve and/or extend tests `colon*.test.)

2010-07-21 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Thu, Jul 22, 2010 at 01:04:03AM CEST: > At Wednesday 21 July 2010, Ralf Wildenhues wrote: > > Well, this is a common dilemma in testing: should the tester be > > allowed to use insider information or not? [...] > > Getting the right balance here is the most non-automa

Re: [PATCH] Modernize, improve and/or extend tests `colon*.test.

2010-07-21 Thread Stefano Lattarini
At Wednesday 21 July 2010, Ralf Wildenhues wrote: > > > Your changes seem to have valued efficiency so far. But > > > calling perl is bound to be more expensive than a couple of > > > greps. > > > > Yes, but it's blazingly fast if compared with an aclocal/automake > > call. > > Sure, but you're

Re: [PATCH] Modernize, improve and/or extend tests `colon*.test.

2010-07-21 Thread Ralf Wildenhues
Hi Stefano, * Stefano Lattarini wrote on Fri, Jun 18, 2010 at 01:25:20PM CEST: > At Thursday 17 June 2010, Ralf Wildenhues wrote: > > Thanks, most of this is uncontroversial, but a couple of things I > > don't understand: > > > --- a/tests/colon3.test > > > +++ b/tests/colon3.test > > > [CUT] > >

Re: [PATCH] Modernize, improve and/or extend tests `colon*.test.

2010-07-17 Thread Stefano Lattarini
Hello Ralf. Ping on this? I'll wait 48 hours, then, if there are no objections, I'll push the patch to maint (with merges to master and branch-1.11, following your earlier advices). Regards, Stefano

Re: [PATCH] Modernize, improve and/or extend tests `colon*.test.

2010-06-18 Thread Stefano Lattarini
n't need all the prerequisites ./configure would look for (erroring out if it fails to find any of them). For example, the older versions of 'ansi.test' seemed to use the "sed hack" to do this. For the record, if I run the colon5.test in its present "sed hack" form,

Re: [PATCH] Modernize, improve and/or extend tests `colon*.test.

2010-06-17 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sat, Jun 12, 2010 at 11:48:15PM CEST: > Another patch tweaking scripts in the testsuite. Thanks, most of this is uncontroversial, but a couple of things I don't understand: > --- a/tests/colon3.test > +++ b/tests/colon3.test > @@ -1,6 +1,6 @@ > #! /bin/sh > -# Copyri

[PATCH] Modernize, improve and/or extend tests `colon*.test.

2010-06-12 Thread Stefano Lattarini
b927d4cbd1d Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Fri, 11 Jun 2010 19:01:00 +0200 Subject: [PATCH] Modernize, improve and/or extend tests `colon*.test. * tests/colon.test: Rely on the `configure.in' stub created by `./defs', rather than writing one from scratch. Do not c