Skip to content

Learning TDD in Modern C++ to grow in software craftsmanship.

License

Notifications You must be signed in to change notification settings

oswinrodrigues/tdd-cpp

Repository files navigation

TDD in CPP

This project demonstrates and documents my learnings as I work through the book by @jlangr, Modern C++ Programming with Test-Driven Development (2013)

Philosophy

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.

Setup

  1. Install Dev Containers for VS Code
  2. Fork this repository on GitHub
  3. Open the fork in a container volume on VS Code
  4. Wait for the container to be created (this is only necessary the first time)

Workflow

This repository uses the CMake Tools extension to build, test and debug.

Build

Any of the following should work:

  • Press F7
  • Select CMake: Build from the Command Palette
  • Click Build button, beside Build heading, under CMake tab, in sidebar

Test

Any of the following should work:

  • Select CMake: Run Tests from the Command Palette
  • Click Run Tests, beside Test heading, under CMake tab, in sidebar
  • Click Run Test, beside or below tdd-cpp, under Testing tab, in sidebar
  • Run ctest in terminal, while in out/build/default/

Alternate options not directly related to CMake are:

  • Run the test executable in terminal e.g. .out/build/default/<test>

Debug

  1. Add any desired breakpoints to the source code
  2. Click Debug Test, beside or below tdd-cpp, under Testing tab, in sidebar

About

Learning TDD in Modern C++ to grow in software craftsmanship.

Topics

Resources

License

Stars

Watchers

Forks