Mocking with boost.test

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Mocking with boost.test

Boost - Users mailing list

Hi all,

 

I was just wondering whether boost.test provides any mocking facilities?

If it doesn’t is there a recommended mocking framework?

 

Any help appreciated.

 

Kind regards

Sean.


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Mocking with boost.test

Boost - Users mailing list

On Sun, Dec 9, 2018 at 5:04 AM Sean Farrow via Boost-users <[hidden email]> wrote:

Hi all,

 

I was just wondering whether boost.test provides any mocking facilities?

If it doesn’t is there a recommended mocking framework?

 

Any help appreciated.

 

Kind regards

Sean.

 
It doesn't.

I've been using, and very much enjoying fakeit[1]. Its developer(s) have taken boost::test into consideration and have a header you can include that specifically integrates with boost, `#include <fakeit\single_header\boost\fakeit.hpp>`.

It has decent but not amazing documentation [2]. It has a pretty good community that interacts through github issues/pull requests, but I haven't found much outside that (blogs, reddit, etc), but that might be because I haven't looked that hard. It is a bit difficult to google for.

I've also tried turtle [3], which is a mocking framework made specifically for boost::test, but I remember being dissapointed in it, It was a while ago, so I don't exactly remember why, I think it was lacking some fetures I was looking for? It also doesn't seem to be maintained anymore, 

Finally, I'd be remiss if I didn't mention Google Mock [4]. It isn't made for use with Boost, it is specifically made for use with Google Test [5], but it should be usable. I haven't tried it, but you may want to consider it.

In general, compared to a language like python, mocking is very difficult to do in C++. It only works for virtual members, so if your codebase isn't interface driven it won't work well. Wanting to use mocking well has made us start using the SOLID [6] principles, which has been a great improvement to the overall quality of our codebase.

Tom

 

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Mocking with boost.test

Boost - Users mailing list

Hi everybody,


I must admit, that I've been dealing with the same problem of choosing an appropriate mocking framework few months ago (I've settled with Turtle for now). It would be incredibly helpful to have this functionality in included in Boost,

whether in Boost::test or in some now framework, e.g. Boost::mock.


Maybe, it could be a good way to simply integrate some of the currently working frameworks, be it FakeIt or Turtle? By the way, Turtle is being maintained, at least to a degree of compatibility with the latest Boost version.


Best regards,

Martin



On 09. 12. 18 13:01, Tom Kent via Boost-users wrote:

On Sun, Dec 9, 2018 at 5:04 AM Sean Farrow via Boost-users <[hidden email]> wrote:

Hi all,

 

I was just wondering whether boost.test provides any mocking facilities?

If it doesn’t is there a recommended mocking framework?

 

Any help appreciated.

 

Kind regards

Sean.

 
It doesn't.

I've been using, and very much enjoying fakeit[1]. Its developer(s) have taken boost::test into consideration and have a header you can include that specifically integrates with boost, `#include <fakeit\single_header\boost\fakeit.hpp>`.

It has decent but not amazing documentation [2]. It has a pretty good community that interacts through github issues/pull requests, but I haven't found much outside that (blogs, reddit, etc), but that might be because I haven't looked that hard. It is a bit difficult to google for.

I've also tried turtle [3], which is a mocking framework made specifically for boost::test, but I remember being dissapointed in it, It was a while ago, so I don't exactly remember why, I think it was lacking some fetures I was looking for? It also doesn't seem to be maintained anymore, 

Finally, I'd be remiss if I didn't mention Google Mock [4]. It isn't made for use with Boost, it is specifically made for use with Google Test [5], but it should be usable. I haven't tried it, but you may want to consider it.

In general, compared to a language like python, mocking is very difficult to do in C++. It only works for virtual members, so if your codebase isn't interface driven it won't work well. Wanting to use mocking well has made us start using the SOLID [6] principles, which has been a great improvement to the overall quality of our codebase.

Tom

 

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Mocking with boost.test

Boost - Users mailing list

I switched from google mock to



On Sun, Dec 9, 2018 at 9:28 AM Martin Beseda via Boost-users <[hidden email]> wrote:

Hi everybody,


I must admit, that I've been dealing with the same problem of choosing an appropriate mocking framework few months ago (I've settled with Turtle for now). It would be incredibly helpful to have this functionality in included in Boost,

whether in Boost::test or in some now framework, e.g. Boost::mock.


Maybe, it could be a good way to simply integrate some of the currently working frameworks, be it FakeIt or Turtle? By the way, Turtle is being maintained, at least to a degree of compatibility with the latest Boost version.


Best regards,

Martin



On 09. 12. 18 13:01, Tom Kent via Boost-users wrote:

On Sun, Dec 9, 2018 at 5:04 AM Sean Farrow via Boost-users <[hidden email]> wrote:

Hi all,

 

I was just wondering whether boost.test provides any mocking facilities?

If it doesn’t is there a recommended mocking framework?

 

Any help appreciated.

 

Kind regards

Sean.

 
It doesn't.

I've been using, and very much enjoying fakeit[1]. Its developer(s) have taken boost::test into consideration and have a header you can include that specifically integrates with boost, `#include <fakeit\single_header\boost\fakeit.hpp>`.

It has decent but not amazing documentation [2]. It has a pretty good community that interacts through github issues/pull requests, but I haven't found much outside that (blogs, reddit, etc), but that might be because I haven't looked that hard. It is a bit difficult to google for.

I've also tried turtle [3], which is a mocking framework made specifically for boost::test, but I remember being dissapointed in it, It was a while ago, so I don't exactly remember why, I think it was lacking some fetures I was looking for? It also doesn't seem to be maintained anymore, 

Finally, I'd be remiss if I didn't mention Google Mock [4]. It isn't made for use with Boost, it is specifically made for use with Google Test [5], but it should be usable. I haven't tried it, but you may want to consider it.

In general, compared to a language like python, mocking is very difficult to do in C++. It only works for virtual members, so if your codebase isn't interface driven it won't work well. Wanting to use mocking well has made us start using the SOLID [6] principles, which has been a great improvement to the overall quality of our codebase.

Tom

 

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users