C++Spec 1.0.0
BDD testing for C++
|
A behavior-driven development testing library for C++ with an RSpec-inspired DSL.
See http://cppspec.readthedocs.org/ for full documentation and a tutorial.
C++Spec requires a compiler and standard library with support for C++23: Currently tested and confirmed working are:
Note: Only the tests require being compiled with C++23 support (-std=c++23
). No other part of an existing project's build must be modified.
The recommended usage is as a subproject integrated into your build system. For CMake this would look something like below:
Specs can then be automatically added as targets with
This will create a separate executable for every file ending in _spec.cpp
in the given directory (recursive) and add them to CTest.
If you've ever used RSpec or Jasmine, chances are you'll be familiar with C++Spec's syntax. For example, this is a C++Spec version of the first snippet on RSpec's README.
Heavily inspired by RSpec and Jasmine.
Copyright © 2014-2024 Katherine Whitlock
The project is licensed under the MIT License.