/gtestExample

Example of Gtest+Cmake

Primary LanguageCMake

GoogleMock + gcov + Cmake example

This repository contains an example of use of Cmake and GoogleMock for a C++ file. It is mostly for personal use.

Prerequsite

  • googlemock is a submodule in this project. Need to download the module before building.
git submodule init
git submodule update
  • cmake should be installed
  • lcov should be installed on Mac
brew install lcov

Use

mkdir _build
cd _build
cmake -Dcoverage=ON ..
make
make test
ctest
make Test_coverage

Inspiration and thanks

I copied upon many, more documented examples found on StackOverflow and: