/cpp_tests

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

Primary LanguageCMake

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

This is a project template. Feel free to use it. It contains all pre-configured CMakeLists.txt, so to use it, just replace project name with your in main CmakeLists.txt, and all target and executable names in CI/CD script.

How to run

Run following commands from project directory.

  1. Create CMake cache
cmake -S . -B cmake-build
  1. Build main target
cmake --build cmake-build --target cpp_tests
  1. Build tests target
cmake --build cmake-build --target cpp_tests_tests
  1. Run main target
  • On Windows:
.\cmake-build\bin\cpp_tests.exe || .\cmake-build\bin\Debug\cpp_tests.exe
  • On POSIX:
.\cmake-build\bin\cpp_tests
  1. Run tests
  • On Windows:
.\cmake-build\bin\cpp_tests_tests.exe || .\cmake-build\bin\Debug\cpp_tests_tests.exe
  • On POSIX:
.\cmake-build\bin\cpp_tests_tests