Getting make check to fail properly

17 views
Skip to first unread message

Ulf Lorenz

unread,
Jan 17, 2014, 4:39:24 PM1/17/14
to libt...@googlegroups.com
Hi,

I also solved the problem with the tests today, i.e., "make check"
reporting tests as passing that actually failed.

The underlying problem is that the automake test runner just runs the
test programs, and only considers a program exit status != 0 as a
failure. On the other hand, googletest by default tries to catch all
errors (failing asserts etc.) and gracefully ends the test program with
an exit status of 0.

Solution: googletest has a flag "--gtest_throw_on_failure". If you add
this to the variable AM_TESTS_FD_REDIRECT in test/Makefile.am, line 23,
the errors are reported properly. Of course, now we have two tests
to fix, but they were broken anyway. :)


Ulf

Juan Jose Garcia-Ripoll

unread,
Jan 22, 2014, 10:21:22 AM1/22/14
to Ulf Lorenz, libt...@googlegroups.com

On Fri, Jan 17, 2014 at 10:39 PM, Ulf Lorenz <u...@wavepacket.org> wrote:
Solution: googletest has a flag "--gtest_throw_on_failure". If you add
this to the variable AM_TESTS_FD_REDIRECT in test/Makefile.am, line 23,
the errors are reported properly. Of course, now we have two tests
to fix, but they were broken anyway. :)

Cool! Thanks for the info. I have added it, please check.


--
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain) 
http://juanjose.garciaripoll.googlepages.com

Ulf Lorenz

unread,
Jan 22, 2014, 6:06:30 PM1/22/14
to libt...@googlegroups.com
On Wed, 22 Jan 2014 16:21:22 +0100
Juan Jose Garcia-Ripoll <juanjose.g...@gmail.com> wrote:

> On Fri, Jan 17, 2014 at 10:39 PM, Ulf Lorenz <u...@wavepacket.org>
> wrote:
>
> > Solution: googletest has a flag "--gtest_throw_on_failure". If you
> > add this to the variable AM_TESTS_FD_REDIRECT in test/Makefile.am,
> > line 23, the errors are reported properly. Of course, now we have
> > two tests to fix, but they were broken anyway. :)
> >
>
> Cool! Thanks for the info. I have added it, please check.

Works for me.


Ulf
Reply all
Reply to author
Forward
0 new messages