Void’s Vault

Knowledge source for efficiency.

GoogleTest and GoogleMock CheatSheets

I made a cheatsheet to help people get into GoogleMock, and I want to share it, along with the links and cues you need when you’ll get started with GoogleTest.

Here’s the link to GoogleMock’s CheatSheet

In order to use GoogleTest, have a look at the Advanced Guide. I recommend reading the sections talking about “Sharing Resources Between Tests in the Same Test Case”, “Global Set-Up and Tear-Down”.

As for the syntax for mock headers, I simply recommend you automate everything. Have a look at gmock_gen.py from GoogleTest’s git. Especially if your team handles multiple programming languages, having to bother about GoogleMock’s headers syntax is a concern you do not want.

Enjoy!