Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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 0:33am

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.
 
Share this answer
 
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.
 
Share this answer
 
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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900