This is a template. A generic starting point for a cpp repo. Absolutely paranoid about style and safety and cleanliness in general. The homework description dictates that we set up the basics first
| Tools | Implemented |
|---|---|
| Clang Compiler | ✅ |
| Google Test | ✅ |
| vcpkg | ✅ |
| ClangFormat | ✅ |
| ClangTidy | ✅ |
| gcov | 🔶 |
| CircleCI | ✅ |
Ren: I am running this using Clion IDE on a Ubuntu machine, careful if you are on Mac/VSCode!
run
source ./setup_vcpkg.shto clone vcpkg, install gtest and put it in your local repository, and set environment variables for the session.
To build and run:
cmake -B build -S . --preset debug
cmake --build build
cd build && ctest
cd -To generate coverage in html run:
cmake -B build -DENABLE_COVERAGE=ON
cmake --build build
cd build
ctest
make coverage
lcov --capture --directory tests --output-file coverage.info --ignore-errors inconsistent
genhtml coverage.info --output-directory coverage_reportthis makes a directory called coverage_report, then under v1 there are a bunch of html files to readily see cov
All pushes to the remote will trigger a pipeline run on CircleCI which builds and tests the code. However, the coverage report is not currently building in the pipeline.
Run to fix all code to match the .clang-format requirements:
find . -name "*.cpp" -o -name "*.h" | xargs clang-format -i