C++Spec 1.1.0
BDD testing for C++
Loading...
Searching...
No Matches
CppSpec::Formatters::BaseFormatter Class Reference
Inheritance diagram for CppSpec::Formatters::BaseFormatter:

Public Member Functions

 BaseFormatter (std::ostream &out_stream=std::cout, bool color=is_terminal())
 BaseFormatter (const BaseFormatter &)=default
 BaseFormatter (const BaseFormatter &copy, std::ostream &out_stream)
void format (const Runnable &runnable)
void format_children (const Runnable &runnable)
virtual void format (const Description &)
virtual void format (const ItBase &)
virtual void cleanup ()
BaseFormatter & set_color_output (bool value)
int get_and_increment_test_counter ()
void reset_test_counter ()
const char * set_color (const char *color)
const char * status_color (Result::Status status)
const char * reset_color ()

Static Public Member Functions

static std::string located_message (const Result &result)
 Prefix a result's message with the file and line of the expectation that reported it.

Protected Attributes

std::ostream & out_stream
int test_counter = 1
bool color_output

Member Function Documentation

◆ located_message()

std::string CppSpec::Formatters::BaseFormatter::located_message ( const Result & result)
inlinestaticnodiscard

Prefix a result's message with the file and line of the expectation that reported it.

Every formatter that prints failure messages as text uses this, so an editor or terminal can jump from any of them to the failing expectation.

Parameters
resultthe result to describe
Returns
file:line: message

The documentation for this class was generated from the following file: