Google Unit Test

Some notes on using Google unit test suite. It covers the following topics

  • How to install it
  • How to enable a subset of tests

How to install it

Github repository

https://github.com/google/googletest

A good intro

http://www.ibm.com/developerworks/aix/library/au-googletestingframework.html

How to use gtest

one approach is that you can generate gtest.h, gtest-all.cc files and add them to your repository. Credits from Simit, “the code can be fused using the fuse_gtest_files.py tool that ships with Google Test”.

 

How to enable a subset of tests

In code use the full name of the test

TEST(LexandParseTest, SimpleAdd ) {...}
::testing::GTEST_FLAG(filter) = "LexandParseTest.SimpleAdd";

or use regular expression

::testing::GTEST_FLAG(filter) = "LexandParseTest*";

You can also do it through the command lines with details in the following link

http://stackoverflow.com/questions/12076072/how-to-run-specific-test-cases-in-googletest

 

Advertisements
This entry was posted in Tools, Uncategorized. Bookmark the permalink.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s