A basic demo of Unit Testing in C++ using Google's free Gtest
The project is testing an my basic visitor pattern demo. I made notes on this pattern here.
No need to install gtest because of the use of Cmake's FetchContent feature to clone and setup gtest. The test's CMakeList is isolated in its subdirectory which the top-level adds with add_subdirectory(test)
, however with this setup it can be a separate project on its own.
The travis setup also builds for clang and gcc on amd64 and arm64.
- CMakeList file: Top-level and Test with gtest cmake setup
- MakeFile (not used)
- Travis CI yaml file
Just clone and run this script: . ./run.sh
Nothing fancy, the focus is the pattern and basic tool setup.