Skip to content

jpilet/gtestcmake

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

gtestcmake: GTest + CMake example

This project demonstrates a way of integrating gtest unit testing library in cmake. The cmake configuratiion downloads gtest at compile time using subversion. It then compiles the getest library and the unit test.

Features:

  • No need for gtest to be installed on the system;
  • No need to duplicate gtest sources in your project;
  • Requires subversion.

Usage

  1. Copy cmake/GTest.cmake in your project

  2. Add

    include("cmake/GTest.cmake")

    in your main CMakeLists.txt

  3. For each test, add a line similar to:

    cxx_test(test_executable_name test_source.cpp libraries gtest_main)

About

GTest + CMake example

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages