Google Test

Here’s a minimal example of a C++ unit test program using Google Test. You can copy the sample code by choosing the Help -> Using Google Test… menu entry.



A Google Test  based unit test needs #include <gtest/gtest-gui.h> in place of the regular gtest.h header file to support BoostTestUi. The gtest-gui.h file can be created from the File -> Create Header -> Google Test… menu. Save the header file somewhere in a gtest subfolder in your include path, typically inside the gtest folder itself.

Create gtest-gui.h

BoostTestUi will detect a Google Test executable without the special #include file and show you a reminder.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s