Click here to Skip to main content
14,452,891 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hey everyone,

I have a project which I have to write unit tests for but for the first time it supposed to be in C++ and I am not familiar with mocking tools and test frameworks for C++.
I would like to get some recommendations from you: cons and pros, free/not free, etc..

Thanks in advance!

What I have tried:

Google test with gtest, but it has some limitations like mocking concrete class and virtual methods
Posted
Updated 30-Dec-19 1:33am
Rate this:
Please Sign up or sign in to vote.

Solution 1

Depending on the toolset which you are using, some testing tools maybe near you. For example the Visual Studio has some frameworks for that. Read the online docuamentation. Else you should ask the people to which you deliver what tools to write.

Else you may need to write some test code and exceute them. Best style is that all of your code gets tested. It makes sense to provide some mock data which can be processed and than checked for the known result.
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

Well, I have actually found something that might be worth trying. It is free so I take no risk. I saw it in another thread in this forum by coincidence. It's called Isolator ++ and it has no mocking limitations of what I've mentioned above.
I will try to apply the same to my project and edit this post to keep you posted about it.
   
Comments
Patrice T 30-Dec-19 4:36am
   
use "Have a Question or Comment?" button to discuss with author of a solution.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100