I am using Linux machine. I have download the googletest package from here
However, there is no installation guide or other blogs related on how to set it up properly Th
An addendum to James C's answer:
Note that building the library using gtest-1.6.0/src/gtest-all.cc
will require you to provide with a main method yourself. If you want to avoid that altogether and use the default implementation of the main method provided by Googletest, build your library including gtest_main.cc
.
That is:
g++ -Igtest-1.6.0/include -Igtest-1.6.0 -c gtest-1.6.0/src/gtest-all.cc gtest-1.6.0/src/gtest_main.cc
^^^^^^^^^^^^^^
ar -rv libgtest_main.a gtest_main.o gtest-all.o
^^^^^^^^^^^^
Also, keep in mind that implementing your own main method is not the recommended way of defining the SetUp
and TearDown
behaviours; you should be using fixtures instead. Check the Googletest documentation on the topic.