This project demonstrates and documents my learnings as I work through the book by @jlangr, Modern C++ Programming with Test-Driven Development (2013)
Commits reflect the TDD process as much as possible, since the final result wouldn't capture that. Follow along through successive commits to watch me 'test-drive' the code.
Key takeaways are summarized and recorded in the notes/
directory. It goes without saying that these are not my original ideas, but rather draw from the book's contents.
- Install Dev Containers for VS Code
- Fork this repository on GitHub
- Open the fork in a container volume on VS Code
- Wait for the container to be created (this is only necessary the first time)
This repository uses the CMake Tools extension to build, test and debug.
Any of the following should work:
- Press
F7
- Select
CMake: Build
from the Command Palette - Click
Build
button, besideBuild
heading, underCMake
tab, in sidebar
Any of the following should work:
- Select
CMake: Run Tests
from the Command Palette - Click
Run Tests
, besideTest
heading, underCMake
tab, in sidebar - Click
Run Test
, beside or belowtdd-cpp
, underTesting
tab, in sidebar - Run
ctest
in terminal, while inout/build/default/
Alternate options not directly related to CMake
are:
- Run the test executable in terminal e.g.
.out/build/default/<test>
- Add any desired breakpoints to the source code
- Click
Debug Test
, beside or belowtdd-cpp
, underTesting
tab, in sidebar