|
C++Spec 1.0.0
BDD testing for C++
|
An it embedded in a Description.
More...
#include <it.hpp>


Public Types | |
| using | Block = std::function<void(ItD&)> |
Public Member Functions | |
| ItD (std::source_location location, const char *description, Block block) | |
| The primary ItD constructor. | |
| ItD (std::source_location location, Block block) | |
| The anonymous ItD constructor. | |
| void | run () override |
Public Member Functions inherited from CppSpec::ItBase | |
| ItBase (std::source_location location) noexcept | |
| Create an BaseIt without an explicit description. | |
| ItBase (std::source_location location, const char *description) noexcept | |
| Create an BaseIt with an explicit description. | |
| bool | needs_description () noexcept |
| Get whether the object needs a description string. | |
| std::string | get_description () const noexcept |
Get the description string for the it statement. | |
| ItBase & | set_description (std::string_view description) noexcept |
| Set the description string. | |
| template<Util::is_not_functional T> | |
| ExpectationValue< T > | expect (T value, std::source_location location=std::source_location::current()) |
The expect object generator for objects and LiteralTypes. | |
| template<Util::is_functional T> | |
| ExpectationFunc< T > | expect (T block, std::source_location location=std::source_location::current()) |
The expect object generator for lambdas. | |
| template<typename T> | |
| ExpectationValue< std::initializer_list< T > > | expect (std::initializer_list< T > init_list, std::source_location location=std::source_location::current()) |
The expect object generator for initializer lists. | |
| template<typename T> | |
| ExpectationValue< T > | expect (Let< T > &let, std::source_location location=std::source_location::current()) |
The expect object generator for Let. | |
| ExpectationValue< std::string > | expect (const char *string, std::source_location location=std::source_location::current()) |
The expect object generator for const char*. | |
| void | add_result (const Result &result) |
| std::list< Result > & | get_results () noexcept |
| const std::list< Result > & | get_results () const noexcept |
| void | clear_results () noexcept |
| Result | get_result () const override |
Public Member Functions inherited from CppSpec::Runnable | |
| Runnable (std::source_location location) | |
| bool | has_parent () noexcept |
| Check to see if the Runnable has a parent. | |
| bool | has_parent () const noexcept |
| Runnable * | get_parent () noexcept |
| Get the Runnable's parent. | |
| const Runnable * | get_parent () const noexcept |
| std::list< std::shared_ptr< Runnable > > & | get_children () noexcept |
| const std::list< std::shared_ptr< Runnable > > & | get_children () const noexcept |
| template<class C> | |
| C * | get_parent_as () noexcept |
| template<class C> | |
| const C * | get_parent_as () const noexcept |
| template<typename T, typename... Args> | |
| T * | make_child (Args &&... args) |
| std::string | padding () const noexcept |
| Generate padding (indentation) fore the current object. | |
| std::source_location | get_location () const noexcept |
| void | set_location (std::source_location location) noexcept |
| virtual void | timed_run () |
| std::chrono::duration< double > | get_runtime () const |
| std::chrono::time_point< std::chrono::system_clock > | get_start_time () const |
| size_t | num_tests () const noexcept |
| size_t | num_failures () const noexcept |
An it embedded in a Description.
ItD objects are the representation of an it in a describe block (not a describe_a) the sole item they contain is the function that represents the block of the it. ItD is derived from ItBase.
|
inline |
The primary ItD constructor.
This constructor is used for creating ItDs that are given a documentation string.
| parent | the parent of the it (i.e. the Description object) |
| description | the documentation string of the it |
| block | the lambda/function passed to the it |
|
inline |
The anonymous ItD constructor.
Not used frequently, as most anonymous its will be ItCD objects, since the syntax lends itself to this. However, the possibility of not giving a documentation string to the it still exists, both to be consistent and for cases it might want to be used.
| parent | the parent of the it (i.e. the Description object) |
| block | the lambda function passed to the it |
|
inlineoverridevirtual |
Implements CppSpec::Runnable.