A project showing the following features:
cmake
-based build for C++ project source files;googletest
as agit submodule
;travis-ci
pipeline for running tests.
C++ project that uses google test as a git submodule and integrates a travis CI pipeline.
CMakeLists.txt
cmake project filesinclude/
header files (*.h
)src/
source files (*.cpp
)test/
test files (*.cpp
)
Use git clone --recursive ...
to download the project and its git submodules.
Otherwise from the project root repository one needs to download the submodules:
git submodule update --init
.
- Creating the executables follows standard
cmake
procedure:
mkdir build
cd build && cmake ..
- Compile the code (it will also compile the gtest for the first time):
make
- Run executable:
./project1
- Cmake supports
add_test
function, then the tests can be launchmake test
orctest
commands.
./runUnitTests