Test-driven development in C using CppUTest with memory leak checks on unit tests.
Configure with CMake. Run with Docker.
This project demonstrates how to compile an application against the unit testing framework CppUTest. It features two compilation methods:
The layout of the build system is:
. ├── build_production/ ├── build_test/ ├── cpputest_intro/ ├── Dockerfiles/ ├── docker_run.sh* ├── docs/ ├── LICENSE ├── production.env.example ├── README.md └── test.env.example
cpputest_intro/ contains the source and test code.
build_production/ is for out-of-tree release/production builds.
build_test/ is for out-of-tree test builds.
Dockerfiles/ contains Dockerfiles that can be used for compilation and testing.
I’ve included it for your convenience, but typically you’ll fetch images yourself.
docker_run.sh is a helper script for starting a Docker container.
.env.example files demonstrates how to configure
isn’t required but it makes things easier.
docs/ contains the source code for these documentation pages.
You are welcome to take a look but you’re already reading the result.
The structure of the source code directory is:
. ├── cpputest_intro/ │ ├── CMakeLists.txt │ ├── include/ │ ├── src/ │ └── tests/
include/ contains header files for the project’s public interface.
src/ contains production code.
tests/ contains code for unit tests.
For detailed build instructions, see one of the following: