Technology moves fast! ⚡ Don't get left behind.🚶 Subscribe to our mailing list to keep up with latest and greatest in open source projects! 🏆


Subscribe to our mailing list

google-test-examples

Short example how to use Google Test with CMake project

Subscribe to updates I use google-test-examples


Statistics on google-test-examples

Number of watchers on Github 215
Number of open issues 0
Average time to close an issue 4 days
Main language CMake
Average time to merge a PR about 5 hours
Open pull requests 3+
Closed pull requests 1+
Last commit over 1 year ago
Repo Created about 8 years ago
Repo Last Updated over 1 year ago
Size 32 KB
Organization / Authorsnikulov
Contributors4
Page Updated
Do you use google-test-examples? Leave a review!
View google-test-examples activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating google-test-examples for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

Short sample how-to use Google C++ Test Framework in cmakeable projects

  1. Google test will be downloaded from GitHub and built with your project

How to use:

  1. git clone https://github.com/snikulov/google-test-examples.git
  2. cd google-test-examples
  3. mkdir build
  4. cd build
  5. cmake ..
  6. cmake --build .
  7. ctest -VV

CI status:

Build Status | Build status

Known issues:

- TBD

How to use (alternativ with docker containers)

Get repo

$ git clone https://github.com/snikulov/google-test-examples.git
$ cd google-test-examples

CMake

We can use CMake to configure/build/running tests:

Host side

$ cmake -P build.cmake

Docker Containers side

cmake -P build_with_docker.cmake

Makefile

Targets

$ make [tab]
make all
all                        build/Makefile             configure                  google-test-examples_test
build                      clean                      DOCKER_COMMAND             run
build_directory            clean_docker_image         docker_image
build_docker_image         CMAKE_COMMAND              DOCKER_IMAGE

Configure/Build/Running tests (with docker containers)

$ make all
docker build -t atty/google-test-examples:latest --file docker/Dockerfile .
Sending build context to Docker daemon  221.2kB
Step 1/1 : FROM rikorose/gcc-cmake:latest
...
1/1 Test #1: test1 ............................   Passed    0.00 sec
100% tests passed, 0 tests failed out of 1

Total Test time (real) =   0.00 sec

Screencast recording

asciicast

google-test-examples open pull requests (View All Pulls)
  • Patch 2
  • Update README
  • Add-ons: CMake + Docker + Makefile
google-test-examples list of languages used
Other projects in CMake