Chebyshev
Unit testing for scientific software
output.h File Reference

The output module, with formatting capabilities. More...

#include <vector>
#include <string>
#include <map>
#include <sstream>
#include <iomanip>
#include "../prec/prec_structures.h"
#include "../benchmark/benchmark_structures.h"
#include "../err/err_structures.h"

Go to the source code of this file.

Classes

class  chebyshev::output::field_options
 Custom options for printing a certain field. More...
 
class  chebyshev::output::output_settings
 Global settings of printing results to standard output. More...
 

Namespaces

 chebyshev
 General namespace of the framework.
 
 chebyshev::output
 Functions to manage printing results.
 
 chebyshev::output::format
 Output formatting functions.
 

Typedefs

using chebyshev::output::OutputFormat = output_settings::OutputFormat_t
 A function which converts the table entries of a row to a string to print (e.g. More...
 

Functions

OutputFormat chebyshev::output::format::barebone ()
 Bare bone output format which just prints the result table as is, without any formatting beyond adjusting column width.
 
OutputFormat chebyshev::output::format::simple ()
 Simple output format which prints the fields separated by the separator string and padding, if enabled. More...
 
OutputFormat chebyshev::output::format::fancy (bool adaptiveWidth=true)
 Fancy output format which uses Unicode characters to print a continuous outline around the table. More...
 
OutputFormat chebyshev::output::format::csv (const std::string &separator=",")
 Format function for CSV format files. More...
 
OutputFormat chebyshev::output::format::markdown ()
 Format the table as Markdown. More...
 
OutputFormat chebyshev::output::format::latex ()
 Format the table as a LaTeX table in the tabular environment. More...
 
void chebyshev::output::setup ()
 Setup printing to the output stream with default options.
 
void chebyshev::output::terminate ()
 Terminate the output module by closing all output files and resetting its settings.
 
std::string chebyshev::output::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 chebyshev::output::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 chebyshev::output::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 chebyshev::output::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 chebyshev::output::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 chebyshev::output::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 chebyshev::output::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 chebyshev::output::open_file (std::string filename)
 Try to open a new output file, returning whether it was correctly opened. More...
 
template<typename ResultType >
void chebyshev::output::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 chebyshev::output::settings
 

Detailed Description

The output module, with formatting capabilities.