|
| | 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.
|
|
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 |
|
| 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 | run ()=0 |
|
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 |
Base class for it expressions.
This class is needed to prevent a circular dependency between it.hpp and basematcher.hpp. Matchers need to know whether or not an it has an explicit description string or whether the description should be generated. its need to be able to refer to Expectations, and Expectations need to know about Matchers and execute them. This class is the least common denominator of the it classes, and thus is used to resolve the dependency cycle.
template<Util::is_not_functional T>
| ExpectationValue< T > CppSpec::ItBase::expect |
( |
T | value, |
|
|
std::source_location | location = std::source_location::current() ) |
The expect object generator for objects and LiteralTypes.
A simple expect statement.
A C string (a char pointer, or a char array, which decays to one) is kept as the pointer it is, so to_be_null() works on it; the string matchers compare it as text. Because a char array decays to a pointer, it is read as a C string, up to its first NUL, so it must be NUL-terminated; pass std::string_view(buffer, size) for a fixed-size buffer that may not be.
- Parameters
-
| value | the item to wrap. This parameter is passed by value so that statements like expect(2) or expect(SomeClass()) can be passed in |
- Template Parameters
-
- Returns
- a ExpectationValue object containing the given value.
expect([] ->
int {
return 4; })