Skip to content

Repository files navigation

Bootstrap for C++ coding kata

CIC++17License: MIT

Start a C++17 coding kata with GoogleTest. Setup is complete when the starter test passes.

Prerequisites

Required:

Optional:

  • GNU Make, for shorter commands. Every required task also has direct CMake and CTest commands.

You do not need to install GoogleTest separately. CMake finds an installed copy or downloads the pinned release when needed.

Set up the kata

  1. Clone the repository:

    git clone https://github.com/Coding-Cuddles/bootstrap-cpp-kata.git
  2. Enter the repository directory:

    cd bootstrap-cpp-kata
  3. Run the starter test. Use Make when it is installed:

    make test

    Otherwise, use CMake and CTest directly:

    cmake -S . -B build -DCMAKE_BUILD_TYPE=Debugcmake --build build --config Debugctest --test-dir build --build-config Debug --output-on-failure

The first run may download and build GoogleTest. Setup is complete when CTest reports 100% tests passed.

If a command reports a missing compiler or CMake, install that prerequisite and run the setup commands again.

Work on the kata

  1. Replace the starter assertions in test_something.cpp with the first kata test.

  2. Run the tests after each change. Use Make when it is installed:

    make test

    Otherwise, use CMake and CTest directly:

    cmake --build build --config Debugctest --test-dir build --build-config Debug --output-on-failure

    Continue when CTest reports 100% tests passed.

Make command reference

Make is optional. Run make or make help to list these commands in the terminal.

CommandResult
make allBuild and run the test suite
make helpShow the Make command reference
make buildConfigure and build without running tests
make testBuild and run the test suite
make formatFormat tracked C++ and header files
make format-checkCheck formatting without changing files
make cleanRemove generated build artifacts

About

Bootstrap repository for clean code katas in C++

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Used by

Contributors

Languages