Unlike Java or other languages where reflection / introspection is available, mocking is not easy with C++. Even with Google Mock, we need some hand writing.

I solved this problem by using home made class definition parser/generator that reads the class definition (header file), then generates a mock class.
What you need is to run the generator and full featured mock class is there for your unit test.

----
How to use:
You need Ruby. Obtain it if you don't have it yet.
Go to
https://sourceforge.net/p/mockerplusplus/code/ci/master/tree/
Download everything except copy-tools.sh (which is for my internal use)
(You can also skip unittest/ if you are not interested)

doc/ folder contains a documentation that explains Mocker++

Code samples (unit test codes) are found in 'unittest/MockerppTest'

Project Activity

See All Activity >

Follow Mocker++

Mocker++ Web Site

Other Useful Business Software
Simplify IT and security with a single endpoint management platform Icon
Simplify IT and security with a single endpoint management platform

Automate the hardest parts of IT

NinjaOne automates the hardest parts of IT, delivering visibility, security, and control over all endpoints for more than 20,000 customers. The NinjaOne automated endpoint management platform is proven to increase productivity, reduce security risk, and lower costs for IT teams and managed service providers. The company seamlessly integrates with a wide range of IT and security technologies. NinjaOne is obsessed with customer success and provides free and unlimited onboarding, training, and support.
Learn More
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Mocker++!

Additional Project Details

Programming Language

C++

Related Categories

C++ Software Testing Tool, C++ Parser Generators

Registered

2013-09-18