On Wed, Nov 9, 2016, at 06:17 PM, Mike Hommey wrote:
> On Thu, Nov 10, 2016 at 11:04:05AM +1100, Nicholas Nethercote wrote:
> > On Thu, Nov 10, 2016 at 10:00 AM, Mike Hommey <m...@glandium.org> wrote:
> > 
> > >
> > > CppUnitTests are fine to keep.
> > 
> > 
> > Having said that, IMO it is desirable to convert CppUnitTests to gtests
> > where possible. Every CppUnitTest has to provide some basic check/pass/fail
> > infrastructure, and many of them provide their own. Converting to gtest
> > provides consistency and usually ends up making tests shorter. E.g. a lot
> > of code like this:
> > 
> >   if (!Foo(bar)) {
> >     printf("Foo failed");
> >     return false;
> >   }
> > 
> > becomes this:
> > 
> >   ASSERT_TRUE(Foo(bar)) << "Foo failed";
> > 
> > The tests in mfbt/tests/ are good candidates for conversion
> 
> Arguably, the tests in mfbt/tests are good examples of what not to touch:
> they are valuable to run (and are built) in e.g. standalone js builds,
> which don't have libxul-gtests.
> 
> The issue of C++ test harness is however real, but it's not a matter of
> a simple conversion: it's a matter of having a non-libxul-gtest gtest
> C++ test harness.
> 
> Mike

+1: When testing new compilers I find it really valuable to have an
assortment of tiny programs in the tree. It lets me work through the
first few layers of bugs in isolation, before diving into the complexity
of libxul. It would be helpful to keep at least some of the CppUnitTests
around in a lightweight form.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to