Feb 2, 2010

Are you mocking me?

If You Give a Programmer a Cookie…

…they’re not going to want a glass of milk, they’re going to want a mocking framework to mock the glass of milk so that they can properly unit taste the cookie. Then they’re going to want a can of Jolt.  Once I got unitTest++ working I immediately wanted an embedded C++ mocking framework. Luckily for me there’s AMOP, Automatic Mock Object for C++. (Maybe the ‘P’ stands for Plus?). Was AMOC already taken?  It was extremely easy to get AMOP set up and working. I had to comment out one wayward include to <memory.h>,  and then enable RTTI, and exceptions. I was then able to create a NB device project and load the unit tests for AMOP and they ran flawlessly. The only documentation for AMOP appears to be the unit tests themselves. While this is fairly useful it always makes me wonder if there are unit tests for all the features or do I need to go looking at the source to discover all the goodies.
Below is a 4 minute screencast on getting the tests up an running in Eclipse for the NetBurner.


About Me

My photo
Tod Gentille (@todgentille) is now a Curriculum Director for Pluralsight. He's been programming professionally since well before you were born and was a software consultant for most of his career. He's also a father, husband, drummer, and windsurfer. He wants to be a guitar player but he just hasn't got the chops for it.