automake-ng
[Top][All Lists]
Advanced

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

Re: [Automake-NG] [PATCH 1/6] [ng] coverage: testing with lots of test s


From: Stefano Lattarini
Subject: Re: [Automake-NG] [PATCH 1/6] [ng] coverage: testing with lots of test scripts
Date: Sun, 22 Jul 2012 09:58:04 +0200

On 07/22/2012 09:24 AM, Akim Demaille wrote:
> 
> Le 21 juil. 2012 à 10:50, Stefano Lattarini a écrit :
> 
>> See long-standing automake bug#7868.
>>
>> * t/parallel-tests-many.sh: Simplify and enhance.  Among the other things,
> 
> I would s/the //.
>
Will fix.

>> this test now tries running ~ 30 thousands tests.  Currently fails on
> 
> I would also 30,000, I don't like too much mixing digits with
> letters, or maybe "30k tests".
>
"30k" is fine with me, I'll use it.

> Just a matter of taste, and just to write something to show I truly
> read the patch :)
>
Eh eh ;-)

>> several systems (e.g., Linux 2.6.30 on i686, Solaris 10 on i86pc).
> 
>> +list_logs | grep . && exit 1
> 
> Back to our regular "let's upgrade Akim's view of portable shell
> programming": are there really today shells used to run the test
> suite that do not support "!"?
>
Nope, the testsuite now requires a POSIX shell.  But I still find the
use of "SOME-CMD | CMD-EXPECTED-TO-FAIL && exit 1" more readable than
the possible alternatives (more details below).

> I personally use it extensively in my test suites, as I find this
> much more legible:
> 
> ! list_logs | grep .
> 
Ah, but this doesn't do what you expect:

  $ bash -c '! echo x | grep .'; echo st = $?
  x
  st = 0
  $ bash -c '! echo | grep .'; echo st = $?
  st = 1

To "deny" the pipeline, you need to enclose it in "()" or "{}":

  $ bash -c '! (echo x | grep .)'; echo st = $?
  x
  st = 1
  $ bash -c '! (echo | grep .)'; echo st = $?
  st = 0

Which proves that my preferred idiom was actually clear :-)

Thanks,
  Stefano



reply via email to

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