Ready to go boilerplate for doing TDD for C/C++ and SCons as build system.
Boilerplate for C/C++ development using TDD and SCons.
Uses GoogleTest for unit testing and to create mocks.
Has already a sample module called func1 with some unit tests and mocks to ease the use of the boilerplate.
To test that your setup is ready, run the following commands. If not, go to Requirements.
git clone --recursive https://github.com/jorgeacortes/c-tdd-boilerplate
scons # Builds the app and tests
Build.py
is a file included in order to manage usual builds.
VS Code configuration and tasks are provided for compiling and debugging.
Dockerfile is also provided to compile over a linux container.
To include your code you need to modify at least:
- project.scons
- include_path_list: add all include paths for production code or common ones.
- mocks_list: in case mocks are needed.
- app.scons
- productionCode_sources: include all sources to compile
- test.scons
- tests_sources: include all sources to compile (mocks and tests)
- Add more runners if needed
- Python
- SCons ->
pip install scons
- Mingw or gcc
- 1.1.0
- Improvements for compiling gtest
- Including Dockerfile
- Including Dockerfile commands at build.py
- 1.0.0
- First version
Feel free to contribute opening issues or pull requests.
- Automatically launch all runners and show results.
- Include GMock.
- Include sample class and fixtures.
- Create a scons file only for google test library.