Skip to content

Latest commit

 

History

History
56 lines (37 loc) · 1002 Bytes

README.md

File metadata and controls

56 lines (37 loc) · 1002 Bytes

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