Catching GMP test failures

Pierre Labastie pierre.labastie at
Thu Feb 9 14:56:26 PST 2012

Le 09/02/2012 22:21, Matt Burgess a écrit :
> On Thu, 2012-02-09 at 21:53 +0100, Pierre Labastie wrote:
>> .
>> Hi,
>> As far as generating the line, the patch is OK,
>> but it seems to me that this command should make
>> the script stop unconditionnally
>> (with a zero exit status if the test succeeded and non zero otherwise).
>> One way to achieve the desired behavior could be to run the
>> line in a sub-shell (enclosing the line between parenthesis):
>> (make check 2>&1 | tee gmp-check-log>>   $TEST_LOG 2>&1&&
>> exit $PIPESTATUS)
> Doh, of course!
>> Another way could be to eliminate any piping to tee during the tests
>> (testing the input line for '| tee'), since
>> the output is recorded anyway in $TEST_LOG...
>> I'd prefer this solution, otherwise we'd have to change how tests
>> are handled on a case by case basis each time the book adds
>> this kind of command (which was only in glibc when jhalfs was written)
> The only issue with omitting the 'tee' is that we use the resultant
> file, 'gmp-check-log' in the very next command.  We could add a
> role="nodump" to the LFS book to prevent that but...
> I notice that glibc-check-log is also used in a 'grep' immediately after
> creation but I can't see how that doesn't end up in the generated
> commands?  However that's done, I guess we should just duplicate for
> gmp-check-log.
> Regards,
> Matt.
Sorry I sent my preceding message before reading yours.

Well, all of this is very dependent on how the book is written.
For glibc, the 3 lines that make the test are just one <userinput>,
so omitting the end is easy, using 'substring-before'...
For gmp, the awk line is another <userinput>, so it would
be another test to omit it. Furthermore, the output of the awk line
might be important to keep in the test log (while grepping Error in
the case of glibc would just clutter the log).

As you can see, I changed my mind since my first post to this thread.
Well, should have reread the gmp page in the book before posting...


More information about the alfs-discuss mailing list