This project contains examples from my ACCU 2022 presentation, Contractual Disappointment in C++.
The project's CI pipeline demonstrates how to maintain high-quality C++ by running automated tests against tools such as:
- AddressSanitizer,
- CppCheck static analyser,
- Clang and GCC compilers,
- Clang Static Analyzer,
- Clang-Tidy C++ linter and static analyser,
- Conan Python-based C++ package manager,
- Include what you use tool to analyze
#include
s, - pre-commit linting framework with
formatting and correctness checks for:
- Bash
- C++
- CMake
- JSON
- Markdown
- Python
- YAML
- UndefinedBehaviorSanitizer.
- Valgrind,
- vcpkg CMake-based C++ package manager.
Developers are invited to suggest or add their favourite tools, or to use this project as the starting point for their own C or C++ projects.
The project is built and tested on Linux and Windows. It is designed to be easy to build and to run with:
- Conan package manager,
- CMake build system generator,
- A C++20-compatible compiler such as Clang, GCC or MSVC.
To build all tests and libraries using Conan on Linux,
-
create an empty build directory,
mkdir -p build cd build/
-
install package dependencies,
conan install --build=missing <path-to-project>
-
then configure, build, test, and install the programs:
conan build <path-to-project>
To build all three utilities using vcpkg on Linux,
-
create an empty build directory,
mkdir -p build cd build/
-
install vcpkg using these instructions,
git clone https://github.com/Microsoft/vcpkg.git ./vcpkg/bootstrap-vcpkg.sh
-
then configure, build, and test the programs:
cmake -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake <path-to-project> cmake --build . ctest