zongkaizhang / cmake_googletest_gcov

A cmake C/C++ project template configured for unit testing and code coverage

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CMake & GoogleTest & GCOV

Description

This is a template of a cmake C/C++ project configured for unit testing with googletest and code coverage with gcov and lcov.

Project structure

.
├── CMakeLists.txt
├── inc
│   └── cub.h
├── lib
│   ├── cmake-modules
│   └── googletest
├── README.md
├── src
│   ├── CMakeLists.txt
│   ├── cub.cc
│   └── main.cpp
└── test
    ├── inc
    └── src
        ├── CMakeLists.txt
        └── cub_test.cc
  • The googletest and cmake-modules were added to this repository via git-subtree, so you can easily update these repositories with the following commands:

    cd root_of_this_project
    git subtree pull --squash --prefix=lib/cmake-modules git@github.com:bilke/cmake-modules.git master
    git subtree pull --squash --prefix=lib/googletest git@github.com:google/googletest.git master

Projects used

Note

  • The code coverage output can be seen by opening the following file in a web browser:

    cmake-build-debug/test_coverage/index.html

About

A cmake C/C++ project template configured for unit testing and code coverage


Languages

Language:C++ 77.3%Language:Python 12.0%Language:CMake 8.6%Language:C 0.8%Language:Shell 0.7%Language:Starlark 0.6%Language:Makefile 0.0%