Chebyshev
Unit testing for scientific software
|
Functions to manage printing results. More...
Namespaces | |
format | |
Output formatting functions. | |
Classes | |
class | field_options |
Custom options for printing a certain field. More... | |
class | output_settings |
Global settings of printing results to standard output. More... | |
Typedefs | |
using | OutputFormat = output_settings::OutputFormat_t |
A function which converts the table entries of a row to a string to print (e.g. More... | |
Functions | |
void | setup () |
Setup printing to the output stream with default options. | |
void | terminate () |
Terminate the output module by closing all output files and resetting its settings. | |
std::string | resolve_field (const std::string &fieldName, prec::estimate_result r) |
Resolve the field of an estimate result by name, returning the value as a string. More... | |
std::string | resolve_field (const std::string &fieldName, prec::equation_result r) |
Resolve the field of an equation result by name, returning the value as a string. More... | |
std::string | resolve_field (const std::string &fieldName, benchmark::benchmark_result r) |
Resolve the field of a benchmark result by name, returning the value as a string. | |
std::string | resolve_field (const std::string &fieldName, err::assert_result r) |
Resolve the field of an assertion result by name, returning the value as a string. More... | |
std::string | resolve_field (const std::string &fieldName, err::errno_result r) |
Resolve the field of an errno checking result by name, returning the value as a string. More... | |
std::string | resolve_field (const std::string &fieldName, err::exception_result r) |
Resolve the field of an exception checking result by name, returning the value as a string. More... | |
template<typename ResultType > | |
auto | generate_table (const std::map< std::string, std::vector< ResultType >> &results, const std::vector< std::string > &fields) |
Generate a table of results as a string matrix to pass to a specific formatter of OutputFormat type. More... | |
bool | open_file (std::string filename) |
Try to open a new output file, returning whether it was correctly opened. More... | |
template<typename ResultType > | |
void | print_results (const std::map< std::string, std::vector< ResultType >> &results, const std::vector< std::string > &fields, const std::vector< std::string > &filenames) |
Print the test results to standard output and output files with their given formats, defaulting to settings.outputFiles if no filenames are specified. More... | |
Variables | |
struct chebyshev::output::output_settings | settings |
Functions to manage printing results.
using chebyshev::output::OutputFormat = typedef output_settings::OutputFormat_t |
A function which converts the table entries of a row to a string to print (e.g.
adding separators and padding).
|
inline |
Generate a table of results as a string matrix to pass to a specific formatter of OutputFormat type.
This function is used by print_results to create the table of results which is then formatted and printed to output.
results | The map of test results of any type |
fields | The fields of the test results to write to each column, in order. |
|
inline |
Try to open a new output file, returning whether it was correctly opened.
This function is called internally and is generally not needed, you can just specify the filenames and the module will open them when needed.
filename | The name of the file |
|
inline |
Print the test results to standard output and output files with their given formats, defaulting to settings.outputFiles if no filenames are specified.
results | The map of test results, of any type |
fields | The fields of the test results to write, in order |
filenames | The names of the module specific output files |
|
inline |
Resolve the field of an assertion result by name, returning the value as a string.
fieldName | The name of the field to resolve |
r | The assertion result to read the fields of |
|
inline |
Resolve the field of an errno checking result by name, returning the value as a string.
fieldName | The name of the field to resolve |
r | The errno checking result to read the fields of |
|
inline |
Resolve the field of an exception checking result by name, returning the value as a string.
fieldName | The name of the field to resolve |
r | The exception checking result to read the fields of |
|
inline |
Resolve the field of an equation result by name, returning the value as a string.
fieldName | The name of the field to resolve |
r | The equation result to read the fields of |
|
inline |
Resolve the field of an estimate result by name, returning the value as a string.
fieldName | The name of the field to resolve |
r | The estimate result to read the fields of |