Chebyshev
Unit testing for scientific software
|
module context. More...
Public Member 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. | |
output_context () | |
Default constructor for the output module. | |
~output_context () | |
Destructor which automatically terminates the module. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
bool | open_file (const std::string &filename) |
Try to open a new output file, returning whether it was correctly opened. | |
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. | |
Public Attributes | |
output_settings | settings |
Settings for the output module. | |
module context.
|
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. |
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.
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 |