These instructions review how to install the GoogleTest unit testing framework library folder (googletestlib) in Eclipse/C++. Then they explain how to create a project that uses the library. At various times during the quarter you will be supplied with unit tests to run on the code you are writing. We often grade programs using these unit tests may be asked to replace various .hpp or .cpp files and recompile the library.
Examine the counter files (both .hpp and .cpp), which describe a trivial class. The test_counter.cpp is the code that is run by GoogleTest.
or
right-click in the test_googletest icon in the
Project Explorer
tabl and select Build Project.
The Console window should show the following.
or
right-click in the test_counter.cpp editor tab and select
select Run As | 1 Local C/C++ Application illustrated below.
The program should begin running and the Console window should show the following.
The output shows passed and failed tests. Examine the counter files (both .hpp and .cpp), which describe a trivial class, and the test_counter.cpp which contains the code that is run by GoogleTest to see why the first test passed and the second one failed.