# sudo yum install gtest gtest-devel
make
#include <gtest/gtest.h> #include <iostream> using namespace std; int add(int, int); TEST(main, addTest){ //given int a = 3; int b = 5; //when int result = add(a, b); //then ASSERT_EQ(result, 8); } int main(int argc, char ** argv){ testing::InitGoogleTest(&argc, argv); int retval = RUN_ALL_TESTS(); if(retval != 0) return retval; } int add(int a, int b){ return a + b; }