Skip to content
/ cpp_tests Public template

C++ Google Tests crossplatform project template with CI/CD. Has a shell installation script.

License

Notifications You must be signed in to change notification settings

bialger/cpp_tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++ project template with Google Tests and CI/CD

This is a project template. Feel free to use & fork it. It contains all pre-configured CMakeLists.txt, so to use it, replace project name with your one in main CmakeLists.txt, and all target and executable names in CI/CD script. Sample program prints a greeting for the first argument.

How to build and run

Run the following commands from the project directory.

  1. Create CMake cache
cmake -S . -B cmake-build
  1. Build executable target
cmake --build cmake-build --target cpp_tests
  1. Build tests target
cmake --build cmake-build --target cpp_tests_tests
  1. Run executable target
  • On Windows:
.\cmake-build\cpp_tests.exe World
  • On *nix:
./cmake-build/bin/cpp_tests World
  1. Run tests
  • On Windows:
.\cmake-build\cpp_tests_tests.exe
  • On *nix:
./cmake-build/tests/cpp_tests_tests