On 23 March 2013 13:13, Vadim Zeitlin <[email protected]> wrote:
>[...]
>
> Personally I think this is a great idea but I admit that I haven't used
> CATCH in really big test suites so I don't know what effect all the
> meta-programming machinery necessary to make the above work has on the
> compile times. Still, I believe CATCH would be a good fit for SOCI, so what
> do you think about starting to use it?
>
>  And if not, using Boost.Test would still be much better than relying on
> bad old assert()...
>
>  Finally, this is definitely not 3.2-critical but it would be nice to have
> an agreement about this before the tests need to be modified the next time.

Using this place to reply as one-to-all posts, not specifically to Vadim's.

There has been a lot of interesting points discussed, some more general
some more SOCI-specific. I however would prefer to avoid attempt to
answer StackOverflow-like question "Which framework is best?".

I have looked at and learned to some extent about
CppUnit, xUnit++, C++TUT, CATCH, Boost.Test and GoogleTest.
I have only used Boost.Test and C++TUT, a lot.
This makes my personal inclinations failry obvious, apart other things like
preferences related to C++ coding style and project guidelines,
familiarity with one community vs others, etc.

Here are some of my more important points:

Using gtest + gmock will effectively add two new
dependencies to SOCI. Same for CATCH + Turtle (or other mocker).
Using Boost.Test + Turtle (Boost.Mock) will add, let's say, one (Turtle)
and 'half' (Boost). Currently Boost is optional but I suppose many if not
most users build SOCI with Boost, same for packes.
If someone has Boost installed, I think it's safe to assume it's complete
Boost distribution, so there are Boost.Test headers available
(if we are header-only-philic here, we'll be fine :-)).
Another important advantages of Turtle is that its interface, style and
conventions match Boost's. This promises seamless integration.

AFAIK, for gtest and gmock, there are no binaries for Windows provided.
Since BoostPro has closed down, situation with Boost binaries for Windows
is now tentative. So, no winners here.
For Linux, packages of both Boost and Google libraries are common.
Neither CATCH nor Turtle seems to be packaged, but Turtle integrates
seamlessly with Boost build configuration.

There are solid communities behind Google and Boost, seems promising.
(Boost.Test has got updates during 2012, several new features too,
Turtle is actively maintained and chances it will be reviewed for Boost
as mentioned in thread "Recommended mock framework to use with Boost?"
http://lists.boost.org/boost-users/2012/01/index.php)

I'm not sure about status of CATCH. I know its author Phil from ACCU.org
and remember there has been load of discussions at the time this library
was forming, but recently it seems slowed down, still not released (?).

As you can see, there is no clear winner from the points above,
except Google and Boost getting best scores for me.
I could draw more points, more pros and cons, but I honestly doubt it
would change anything for the discussion on which one to choose.

Unless a solid reason appears that will back up one option,
I think the choice will be made driven by
"self-regulated natural forces of community" (tm) :-),
that is at some point someone will start rewriting tests, will make no-brainer
decision choosing her/his preferred testing framework and complete certain
substantial amount of work in this area.

If I will start first, I probably will go for Boost.Test + Turtle (Boost.Mock).
Vadim may like to choose CATCH + Turtle|HippoMock|gmock|...
Someone else may go for gtest + gmock.

First contribute, First decide.

Why I mention mock every time?
I'd really like to add set of proper unit tests, along with integration tests
based on rewriting current tests. I'm also hoping to use this as
opportunity to master testing+mocking techniques myself.
So, I assume use of testing and mocking tools.


p.s. It looks this thread has grown a lot here, so moving it to soci-devel
may be too confusing. It also seems nobody complained on it here on
soci-users, so I don't mind to continue it here.
Although, let's try to discuss devel-specific stuff at soci-devel in future.

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net

------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to